File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
test/Transforms/LoopVectorize/AArch64 Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -4813,17 +4813,16 @@ LoopVectorizationCostModel::getSmallestAndWidestTypes() {
48134813 // if there are no loads/stores in the loop. In this case, check through the
48144814 // reduction variables to determine the maximum width.
48154815 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 ;
48194816 for (const auto &PhiDescriptorPair : Legal->getReductionVars ()) {
48204817 const RecurrenceDescriptor &RdxDesc = PhiDescriptorPair.second ;
48214818 // When finding the min width used by the recurrence we need to account
48224819 // 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 >(
48254822 RdxDesc.getMinWidthCastToRecurrenceTypeInBits (),
48264823 RdxDesc.getRecurrenceType ()->getScalarSizeInBits ()));
4824+ MaxWidth = std::max<unsigned >(
4825+ MaxWidth, RdxDesc.getRecurrenceType ()->getScalarSizeInBits ());
48274826 }
48284827 } else {
48294828 for (Type *T : ElementTypesInLoop) {
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ for.end:
3737; chosen. The following 3 cases check different combinations of widths.
3838
3939; 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
4141; CHECK: Selecting VF: 4
4242
4343define double @no_loads_stores_32 (i32 %n ) {
@@ -60,7 +60,7 @@ for.end:
6060}
6161
6262; 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
6464; CHECK: Selecting VF: 8
6565
6666define double @no_loads_stores_16 () {
@@ -82,7 +82,7 @@ for.end:
8282}
8383
8484; 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
8686; CHECK: Selecting VF: 16
8787
8888define float @no_loads_stores_8 () {
You can’t perform that action at this time.
0 commit comments