summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2014-05-13 06:07:21 +0000
committerSerge Pavlov <sepavloff@gmail.com>2014-05-13 06:07:21 +0000
commitb575ee8294e9a6472cb7fb05339d40996247053e (patch)
tree578593b4d032f181c4d83c48d1a3fe9a479aa415 /llvm/lib/Transforms
parente897d7e7c2fe6ac21650de063101c65b28ca1149 (diff)
downloadbcm5719-llvm-b575ee8294e9a6472cb7fb05339d40996247053e.tar.gz
bcm5719-llvm-b575ee8294e9a6472cb7fb05339d40996247053e.zip
Fix type of shuffle resulted from shuffle merge.
This fix resolves PR19730. llvm-svn: 208666
Diffstat (limited to 'llvm/lib/Transforms')
-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 bd647d9e1cd..8c5e202b5c5 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
@@ -1114,12 +1114,10 @@ Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
// If the result mask is an identity, replace uses of this instruction with
// corresponding argument.
- if (VWidth == LHSWidth) {
- bool isLHSID, isRHSID;
- RecognizeIdentityMask(newMask, isLHSID, isRHSID);
- if (isLHSID) return ReplaceInstUsesWith(SVI, newLHS);
- if (isRHSID) return ReplaceInstUsesWith(SVI, newRHS);
- }
+ bool isLHSID, isRHSID;
+ RecognizeIdentityMask(newMask, isLHSID, isRHSID);
+ if (isLHSID && VWidth == LHSOp0Width) return ReplaceInstUsesWith(SVI, newLHS);
+ if (isRHSID && VWidth == RHSOp0Width) return ReplaceInstUsesWith(SVI, newRHS);
return MadeChange ? &SVI : nullptr;
}
OpenPOWER on IntegriCloud