File tree 2 files changed +7
-8
lines changed
test/Transforms/LoopVectorize/AArch64
2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -4813,17 +4813,16 @@ LoopVectorizationCostModel::getSmallestAndWidestTypes() {
4813
4813
// if there are no loads/stores in the loop. In this case, check through the
4814
4814
// reduction variables to determine the maximum width.
4815
4815
if (ElementTypesInLoop.empty() && !Legal->getReductionVars().empty()) {
4816
- // Reset MaxWidth so that we can find the smallest type used by recurrences
4817
- // in the loop.
4818
- MaxWidth = -1U;
4819
4816
for (const auto &PhiDescriptorPair : Legal->getReductionVars()) {
4820
4817
const RecurrenceDescriptor &RdxDesc = PhiDescriptorPair.second;
4821
4818
// When finding the min width used by the recurrence we need to account
4822
4819
// for casts on the input operands of the recurrence.
4823
- MaxWidth = std::min<unsigned>(
4824
- MaxWidth , std::min<unsigned>(
4820
+ MinWidth = std::min<unsigned>(
4821
+ MinWidth , std::min<unsigned>(
4825
4822
RdxDesc.getMinWidthCastToRecurrenceTypeInBits(),
4826
4823
RdxDesc.getRecurrenceType()->getScalarSizeInBits()));
4824
+ MaxWidth = std::max<unsigned>(
4825
+ MaxWidth, RdxDesc.getRecurrenceType()->getScalarSizeInBits());
4827
4826
}
4828
4827
} else {
4829
4828
for (Type *T : ElementTypesInLoop) {
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ for.end:
37
37
; chosen. The following 3 cases check different combinations of widths.
38
38
39
39
; CHECK-LABEL: Checking a loop in 'no_loads_stores_32'
40
- ; CHECK: The Smallest and Widest types: 4294967295 / 32 bits
40
+ ; CHECK: The Smallest and Widest types: 32 / 64 bits
41
41
; CHECK: Selecting VF: 4
42
42
43
43
define double @no_loads_stores_32 (i32 %n ) {
@@ -60,7 +60,7 @@ for.end:
60
60
}
61
61
62
62
; CHECK-LABEL: Checking a loop in 'no_loads_stores_16'
63
- ; CHECK: The Smallest and Widest types: 4294967295 / 16 bits
63
+ ; CHECK: The Smallest and Widest types: 16 / 64 bits
64
64
; CHECK: Selecting VF: 8
65
65
66
66
define double @no_loads_stores_16 () {
@@ -82,7 +82,7 @@ for.end:
82
82
}
83
83
84
84
; CHECK-LABEL: Checking a loop in 'no_loads_stores_8'
85
- ; CHECK: The Smallest and Widest types: 4294967295 / 8 bits
85
+ ; CHECK: The Smallest and Widest types: 8 / 32 bits
86
86
; CHECK: Selecting VF: 16
87
87
88
88
define float @no_loads_stores_8 () {
You can’t perform that action at this time.
0 commit comments