Fix type of shuffle resulted from shuffle merge.
This fix resolves PR19730.
llvm-svn: 208666
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
index bd647d9..8c5e202 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
@@ -1114,12 +1114,10 @@
// 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;
}