[llvm] 385572c - [InstCombine] remove duplicate code for simplifying a shuffle; NFCI

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 10:12:32 PST 2019


Author: Sanjay Patel
Date: 2019-11-14T13:12:25-05:00
New Revision: 385572ccfe5048682d76ed3053a9f41ba89d8dd3

URL: https://github.com/llvm/llvm-project/commit/385572ccfe5048682d76ed3053a9f41ba89d8dd3
DIFF: https://github.com/llvm/llvm-project/commit/385572ccfe5048682d76ed3053a9f41ba89d8dd3.diff

LOG: [InstCombine] remove duplicate code for simplifying a shuffle; NFCI

The transform is already handled by InstSimplify or earlier
in InstCombine, so trying to do it again is not necessary.

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
index 824486cf0a6f..346b0cb1d6df 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
@@ -2242,12 +2242,5 @@ Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
     return new ShuffleVectorInst(newLHS, newRHS, ConstantVector::get(Elts));
   }
 
-  // If the result mask is an identity, replace uses of this instruction with
-  // corresponding argument.
-  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;
 }


        


More information about the llvm-commits mailing list