Skip to content

Commit fb5a005

Browse files
author
klensy
committed
remove needless if
1 parent 4aa3b11 commit fb5a005

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13861,18 +13861,16 @@ class BoUpSLP::ShuffleInstructionBuilder final : public BaseShuffleAnalysis {
1386113861
assert(V1->getType()->isIntOrIntVectorTy() &&
1386213862
V2->getType()->isIntOrIntVectorTy() &&
1386313863
"Expected integer vector types only.");
13864-
if (V1->getType() != V2->getType()) {
13865-
if (cast<VectorType>(V2->getType())
13866-
->getElementType()
13867-
->getIntegerBitWidth() < cast<VectorType>(V1->getType())
13868-
->getElementType()
13869-
->getIntegerBitWidth())
13870-
V2 = Builder.CreateIntCast(
13871-
V2, V1->getType(), !isKnownNonNegative(V2, SimplifyQuery(DL)));
13872-
else
13873-
V1 = Builder.CreateIntCast(
13874-
V1, V2->getType(), !isKnownNonNegative(V1, SimplifyQuery(DL)));
13875-
}
13864+
if (cast<VectorType>(V2->getType())
13865+
->getElementType()
13866+
->getIntegerBitWidth() < cast<VectorType>(V1->getType())
13867+
->getElementType()
13868+
->getIntegerBitWidth())
13869+
V2 = Builder.CreateIntCast(
13870+
V2, V1->getType(), !isKnownNonNegative(V2, SimplifyQuery(DL)));
13871+
else
13872+
V1 = Builder.CreateIntCast(
13873+
V1, V2->getType(), !isKnownNonNegative(V1, SimplifyQuery(DL)));
1387613874
}
1387713875
Value *Vec = Builder.CreateShuffleVector(V1, V2, Mask);
1387813876
if (auto *I = dyn_cast<Instruction>(Vec)) {

0 commit comments

Comments
 (0)