summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-11-25 11:11:12 -0500
committerSanjay Patel <spatel@rotateright.com>2019-11-25 11:11:12 -0500
commitfc31b58eff9da4447f9f332f07de3cd07ab4b56c (patch)
treecb78c28cc73b1288af2f5933f77d6529f915efb7 /llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
parent847aabf11f988a774ae8078a2e567dad8c709bbe (diff)
downloadbcm5719-llvm-fc31b58eff9da4447f9f332f07de3cd07ab4b56c.tar.gz
bcm5719-llvm-fc31b58eff9da4447f9f332f07de3cd07ab4b56c.zip
[InstCombine] simplify code for shuffle mask canonicalization; NFC
We never use the local 'Mask' before returning, so that was dead code.
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
index 2f9d342daca..fd31f524e5c 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
@@ -1900,13 +1900,11 @@ Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
continue;
}
- if (Mask[i] < (int)LHSWidth && isa<UndefValue>(LHS)) {
- Mask[i] = -1; // Turn into undef.
+ // Change select of undef to undef mask element or force to LHS.
+ if (Mask[i] < (int)LHSWidth && isa<UndefValue>(LHS))
Elts.push_back(UndefValue::get(Int32Ty));
- } else {
- Mask[i] = Mask[i] % LHSWidth; // Force to LHS.
- Elts.push_back(ConstantInt::get(Int32Ty, Mask[i]));
- }
+ else
+ Elts.push_back(ConstantInt::get(Int32Ty, Mask[i] % LHSWidth));
}
SVI.setOperand(0, SVI.getOperand(1));
SVI.setOperand(1, UndefValue::get(RHS->getType()));
OpenPOWER on IntegriCloud