Revert "[SLP] Check for PHI nodes (potentially cycles!) when checking… · llvm/llvm-project@d90afbc (original) (raw)

File tree

4 files changed

lines changed

4 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -13181,16 +13181,8 @@ BoUpSLP::isGatherShuffledSingleRegisterEntry(
13181 13181 continue;
13182 13182 // If the user instruction is used for some reason in different
13183 13183 // vectorized nodes - make it depend on index.
13184 - // If any vector node is PHI node, this dependency might not work
13185 - // because of cycle dependencies, so disable it.
13186 13184 if (TEUseEI.UserTE != UseEI.UserTE &&
13187 - (TEUseEI.UserTE->Idx < UseEI.UserTE->Idx |
13188 - any_of(
13189 - VectorizableTree,
13190 - [](const std::unique_ptr &TE) {
13191 - return TE->State == TreeEntry::Vectorize &&
13192 - TE->getOpcode() == Instruction::PHI;
13193 - })))
13185 + TEUseEI.UserTE->Idx < UseEI.UserTE->Idx)
13194 13186 continue;
13195 13187 }
13196 13188
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ define void @test() {
31 31 ; CHECK-NEXT: [[TOBOOL:%.*]] = fcmp une float [[I2]], 0.000000e+00
32 32 ; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <2 x float> [[TMP5]], <2 x float> poison, <2 x i32> <i32 poison, i32 0>
33 33 ; CHECK-NEXT: [[TMP9]] = insertelement <2 x float> [[TMP8]], float [[I2]], i32 0
34 -; CHECK-NEXT: [[TMP10]] = insertelement <2 x float> [[TMP2]], float [[I2]], i32 0
34 +; CHECK-NEXT: [[TMP10]] = shufflevector <2 x float> [[TMP9]], <2 x float> [[TMP2]], <2 x i32> <i32 0, i32 3>
35 35 ; CHECK-NEXT: br i1 [[TOBOOL]], label [[BB1]], label [[BB2]]
36 36 ;
37 37 entry:
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
8 8 ; YAML: Function: test
9 9 ; YAML: Args:
10 10 ; YAML: - String: 'Stores SLP vectorized with cost '
11 -; YAML: - Cost: '-3'
11 +; YAML: - Cost: '-6'
12 12 ; YAML: - String: ' and with tree size '
13 13 ; YAML: - TreeSize: '14'
14 14 ; YAML: ...