Skip to content

Commit 22b4b1a

Browse files
Revert "[SLP][REVEC] Make GetMinMaxCost support FixedVectorType when REVEC is enabled. (#114946)"
This reverts commit f58757b. Failing buildbots: https://lab.llvm.org/buildbot/#/builders/174/builds/8058 https://lab.llvm.org/buildbot/#/builders/127/builds/1357
1 parent b970a78 commit 22b4b1a

File tree

2 files changed

+1
-42
lines changed

2 files changed

+1
-42
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10980,8 +10980,7 @@ BoUpSLP::getEntryCost(const TreeEntry *E, ArrayRef<Value *> VectorizedVals,
1098010980
// If the selects are the only uses of the compares, they will be
1098110981
// dead and we can adjust the cost by removing their cost.
1098210982
if (VI && SelectOnly) {
10983-
assert((!Ty->isVectorTy() || SLPReVec) &&
10984-
"Expected only for scalar type.");
10983+
assert(!Ty->isVectorTy() && "Expected only for scalar type.");
1098510984
auto *CI = cast<CmpInst>(VI->getOperand(0));
1098610985
IntrinsicCost -= TTI->getCmpSelInstrCost(
1098710986
CI->getOpcode(), Ty, Builder.getInt1Ty(), CI->getPredicate(),

llvm/test/Transforms/SLPVectorizer/RISCV/revec.ll

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -94,43 +94,3 @@ entry:
9494
%23 = fcmp ogt <8 x float> zeroinitializer, %19
9595
ret void
9696
}
97-
98-
define void @test3(float %0) {
99-
; CHECK-LABEL: @test3(
100-
; CHECK-NEXT: entry:
101-
; CHECK-NEXT: br label [[FOR_BODY_LR_PH:%.*]]
102-
; CHECK: for.body.lr.ph:
103-
; CHECK-NEXT: [[TMP1:%.*]] = call <4 x float> @llvm.vector.insert.v4f32.v2f32(<4 x float> poison, <2 x float> zeroinitializer, i64 0)
104-
; CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.vector.insert.v4f32.v2f32(<4 x float> [[TMP1]], <2 x float> zeroinitializer, i64 2)
105-
; CHECK-NEXT: br i1 false, label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY:%.*]]
106-
; CHECK: for.cond.cleanup:
107-
; CHECK-NEXT: [[TMP3:%.*]] = phi <4 x float> [ [[TMP2]], [[FOR_BODY_LR_PH]] ], [ [[TMP10:%.*]], [[FOR_BODY]] ]
108-
; CHECK-NEXT: ret void
109-
; CHECK: for.body:
110-
; CHECK-NEXT: [[TMP4:%.*]] = load <2 x float>, ptr null, align 4
111-
; CHECK-NEXT: [[TMP5:%.*]] = fcmp olt <2 x float> zeroinitializer, [[TMP4]]
112-
; CHECK-NEXT: [[TMP6:%.*]] = call <4 x i1> @llvm.vector.insert.v4i1.v2i1(<4 x i1> poison, <2 x i1> <i1 true, i1 true>, i64 0)
113-
; CHECK-NEXT: [[TMP7:%.*]] = call <4 x i1> @llvm.vector.insert.v4i1.v2i1(<4 x i1> [[TMP6]], <2 x i1> [[TMP5]], i64 2)
114-
; CHECK-NEXT: [[TMP8:%.*]] = call <4 x float> @llvm.vector.insert.v4f32.v2f32(<4 x float> poison, <2 x float> [[TMP4]], i64 0)
115-
; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <4 x float> [[TMP8]], <4 x float> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
116-
; CHECK-NEXT: [[TMP10]] = select <4 x i1> [[TMP7]], <4 x float> [[TMP9]], <4 x float> [[TMP2]]
117-
; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]
118-
;
119-
entry:
120-
br label %for.body.lr.ph
121-
122-
for.body.lr.ph:
123-
br i1 false, label %for.cond.cleanup, label %for.body
124-
125-
for.cond.cleanup: ; preds = %for.body, %for.body.lr.ph
126-
%1 = phi <2 x float> [ zeroinitializer, %for.body.lr.ph ], [ %5, %for.body ]
127-
%2 = phi <2 x float> [ zeroinitializer, %for.body.lr.ph ], [ %6, %for.body ]
128-
ret void
129-
130-
for.body:
131-
%3 = load <2 x float>, ptr null, align 4
132-
%4 = fcmp olt <2 x float> zeroinitializer, %3
133-
%5 = select <2 x i1> <i1 true, i1 true>, <2 x float> %3, <2 x float> zeroinitializer
134-
%6 = select <2 x i1> %4, <2 x float> %3, <2 x float> zeroinitializer
135-
br label %for.cond.cleanup
136-
}

0 commit comments

Comments
 (0)