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
This commit is contained in:
Serge Pavlov
2014-05-13 06:07:21 +00:00
parent e2b37447b7
commit 51a167d6c4
2 changed files with 12 additions and 6 deletions

View File

@ -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;
}