diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2014-05-13 06:07:21 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2014-05-13 06:07:21 +0000 |
commit | 51a167d6c4612d82a43227c293e287a9f5108591 (patch) | |
tree | cfe51f6cf4c77b8614bc221a1e73b06166febff8 /lib/Transforms | |
parent | e2b37447b715b1eaa507de117fcb18beea6a4601 (diff) |
Fix type of shuffle resulted from shuffle merge.
This fix resolves PR19730.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208666 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index bd647d9e1cd..8c5e202b5c5 100644 --- a/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/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; } |