Skip to content

Commit d90afbc

Browse files
committed
Revert "[SLP] Check for PHI nodes (potentially cycles!) when checking dependencies"
This reverts commit 2eb558c. This commit did not pass pre-commit CI.
1 parent 2eb558c commit d90afbc

File tree

4 files changed

+3
-70
lines changed

4 files changed

+3
-70
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13181,16 +13181,8 @@ BoUpSLP::isGatherShuffledSingleRegisterEntry(
1318113181
continue;
1318213182
// If the user instruction is used for some reason in different
1318313183
// 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.
1318613184
if (TEUseEI.UserTE != UseEI.UserTE &&
13187-
(TEUseEI.UserTE->Idx < UseEI.UserTE->Idx ||
13188-
any_of(
13189-
VectorizableTree,
13190-
[](const std::unique_ptr<TreeEntry> &TE) {
13191-
return TE->State == TreeEntry::Vectorize &&
13192-
TE->getOpcode() == Instruction::PHI;
13193-
})))
13185+
TEUseEI.UserTE->Idx < UseEI.UserTE->Idx)
1319413186
continue;
1319513187
}
1319613188

llvm/test/Transforms/SLPVectorizer/X86/delayed-gather-emission.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ define void @test() {
3131
; CHECK-NEXT: [[TOBOOL:%.*]] = fcmp une float [[I2]], 0.000000e+00
3232
; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <2 x float> [[TMP5]], <2 x float> poison, <2 x i32> <i32 poison, i32 0>
3333
; 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>
3535
; CHECK-NEXT: br i1 [[TOBOOL]], label [[BB1]], label [[BB2]]
3636
;
3737
entry:

llvm/test/Transforms/SLPVectorizer/X86/matching-gather-nodes-phi-users.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
; YAML: Function: test
99
; YAML: Args:
1010
; YAML: - String: 'Stores SLP vectorized with cost '
11-
; YAML: - Cost: '-3'
11+
; YAML: - Cost: '-6'
1212
; YAML: - String: ' and with tree size '
1313
; YAML: - TreeSize: '14'
1414
; YAML: ...

llvm/test/Transforms/SLPVectorizer/X86/phi-node-with-cycle.ll

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)