summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-11-25 10:40:21 -0500
committerSanjay Patel <spatel@rotateright.com>2019-11-25 10:41:50 -0500
commit20684092ab600d166f0346485945d5d618b08420 (patch)
tree9f09f696d119a58b4ca7f6987a2cf5723228995f /llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
parent21f26470e9747c472d3c18654e676cbea8393635 (diff)
downloadbcm5719-llvm-20684092ab600d166f0346485945d5d618b08420.tar.gz
bcm5719-llvm-20684092ab600d166f0346485945d5d618b08420.zip
[InstCombine] simplify loop for shuffle mask canonicalization; NFC
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
index 54298949cba..eae8bd7452d 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
@@ -1893,18 +1893,18 @@ Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
if (LHS == RHS || isa<UndefValue>(LHS)) {
// Remap any references to RHS to use LHS.
SmallVector<Constant*, 16> Elts;
- for (unsigned i = 0, e = LHSWidth; i != VWidth; ++i) {
+ for (unsigned i = 0; i != VWidth; ++i) {
if (Mask[i] < 0) {
Elts.push_back(UndefValue::get(Int32Ty));
continue;
}
- if ((Mask[i] >= (int)e && isa<UndefValue>(RHS)) ||
- (Mask[i] < (int)e && isa<UndefValue>(LHS))) {
+ if ((Mask[i] >= (int)LHSWidth && isa<UndefValue>(RHS)) ||
+ (Mask[i] < (int)LHSWidth && isa<UndefValue>(LHS))) {
Mask[i] = -1; // Turn into undef.
Elts.push_back(UndefValue::get(Int32Ty));
} else {
- Mask[i] = Mask[i] % e; // Force to LHS.
+ Mask[i] = Mask[i] % LHSWidth; // Force to LHS.
Elts.push_back(ConstantInt::get(Int32Ty, Mask[i]));
}
}
OpenPOWER on IntegriCloud