diff --git a/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index c76aa4c2e6c..d43093d8316 100644 --- a/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -820,12 +820,7 @@ Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) { if (isRHSID) return ReplaceInstUsesWith(SVI, RHS); } - if (isa(RHS) && - // This isn't necessary for correctness, but the comment block below - // claims that there are cases where folding two shuffles into one would - // cause worse codegen on some targets. - !isa(LHS) && - CanEvaluateShuffled(LHS, Mask)) { + if (isa(RHS) && CanEvaluateShuffled(LHS, Mask)) { Value *V = EvaluateInDifferentElementOrder(LHS, Mask); return ReplaceInstUsesWith(SVI, V); }