[llvm] 4459a11 - Revert "[SLP]Fix PR52756: SLPVectorizer crashes with assertion VecTy == FinalVecTy."
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 20 07:22:45 PST 2021
Author: Alexey Bataev
Date: 2021-12-20T07:21:18-08:00
New Revision: 4459a11f4d48cd1c0bf8b5e76e6428bf112615cd
URL: https://github.com/llvm/llvm-project/commit/4459a11f4d48cd1c0bf8b5e76e6428bf112615cd
DIFF: https://github.com/llvm/llvm-project/commit/4459a11f4d48cd1c0bf8b5e76e6428bf112615cd.diff
LOG: Revert "[SLP]Fix PR52756: SLPVectorizer crashes with assertion VecTy == FinalVecTy."
This reverts commit fcaf290d0278bb83387e1a1d972c55e08b8c40e3 to fix test
mismatch reported in https://lab.llvm.org/buildbot#builders/117/builds/3531
Added:
Modified:
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Removed:
llvm/test/Transforms/SLPVectorizer/X86/reused-undefs.ll
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 08fec6dca0bc5..cbcdcc3cf325b 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -3568,11 +3568,8 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
} else {
LLVM_DEBUG(dbgs() << "SLP: Shuffle for reused scalars.\n");
if (NumUniqueScalarValues <= 1 ||
- (UniquePositions.size() == 1 && all_of(UniqueValues,
- [](Value *V) {
- return isa<UndefValue>(V) ||
- !isConstant(V);
- })) ||
+ (NumUniqueScalarValues == 2 &&
+ any_of(UniqueValues, UndefValue::classof)) ||
!llvm::isPowerOf2_32(NumUniqueScalarValues)) {
LLVM_DEBUG(dbgs() << "SLP: Scalar used twice in bundle.\n");
newTreeEntry(VL, None /*not vectorized*/, S, UserTreeIdx);
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/reused-undefs.ll b/llvm/test/Transforms/SLPVectorizer/X86/reused-undefs.ll
deleted file mode 100644
index c587adfa9d11f..0000000000000
--- a/llvm/test/Transforms/SLPVectorizer/X86/reused-undefs.ll
+++ /dev/null
@@ -1,40 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -S -slp-vectorizer -mtriple=x86_64-unknown-linux-gnu -slp-threshold=-1000 < %s | FileCheck %s
-
-define i32 @main(i32 %0) {
-; CHECK-LABEL: @main(
-; CHECK-NEXT: for.cond.preheader:
-; CHECK-NEXT: br i1 false, label [[FOR_END:%.*]], label [[FOR_INC_PREHEADER:%.*]]
-; CHECK: for.inc.preheader:
-; CHECK-NEXT: [[TMP1:%.*]] = insertelement <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 poison, i32 poison>, i32 [[TMP0:%.*]], i32 6
-; CHECK-NEXT: br i1 false, label [[FOR_END]], label [[L1_PREHEADER:%.*]]
-; CHECK: for.end:
-; CHECK-NEXT: [[DOTPR:%.*]] = phi i32 [ 0, [[FOR_INC_PREHEADER]] ], [ 0, [[FOR_COND_PREHEADER:%.*]] ]
-; CHECK-NEXT: [[TMP2:%.*]] = insertelement <8 x i32> poison, i32 [[DOTPR]], i32 0
-; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <8 x i32> [[TMP2]], <8 x i32> poison, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 0, i32 0, i32 0, i32 0, i32 0>
-; CHECK-NEXT: br label [[L1_PREHEADER]]
-; CHECK: L1.preheader:
-; CHECK-NEXT: [[TMP3:%.*]] = phi <8 x i32> [ [[SHUFFLE]], [[FOR_END]] ], [ [[TMP1]], [[FOR_INC_PREHEADER]] ]
-; CHECK-NEXT: ret i32 0
-;
-for.cond.preheader:
- br i1 false, label %for.end, label %for.inc.preheader
-
-for.inc.preheader:
- br i1 false, label %for.end, label %L1.preheader
-
-for.end:
- %.pr = phi i32 [ 0, %for.inc.preheader ], [ 0, %for.cond.preheader ]
- br label %L1.preheader
-
-L1.preheader:
- %1 = phi i32 [ %.pr, %for.end ], [ %0, %for.inc.preheader ]
- %2 = phi i32 [ %.pr, %for.end ], [ 0, %for.inc.preheader ]
- %3 = phi i32 [ %.pr, %for.end ], [ 0, %for.inc.preheader ]
- %4 = phi i32 [ %.pr, %for.end ], [ undef, %for.inc.preheader ]
- %j.2.ph1 = phi i32 [ %.pr, %for.end ], [ 0, %for.inc.preheader ]
- %k.0.ph = phi i32 [ undef, %for.end ], [ 0, %for.inc.preheader ]
- %o.1.ph = phi i32 [ undef, %for.end ], [ 0, %for.inc.preheader ]
- %n.1.ph = phi i32 [ undef, %for.end ], [ 0, %for.inc.preheader ]
- ret i32 0
-}
More information about the llvm-commits
mailing list