[llvm] 47cfe71 - [DAG] MatchRotate - reuse existing LHSShiftArg/RHSShiftArg variables. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 18 06:35:53 PDT 2022


Author: Simon Pilgrim
Date: 2022-09-18T14:35:10+01:00
New Revision: 47cfe7102711cf3414eb32cf61d47a670ee28cb6

URL: https://github.com/llvm/llvm-project/commit/47cfe7102711cf3414eb32cf61d47a670ee28cb6
DIFF: https://github.com/llvm/llvm-project/commit/47cfe7102711cf3414eb32cf61d47a670ee28cb6.diff

LOG: [DAG] MatchRotate - reuse existing LHSShiftArg/RHSShiftArg variables. NFC.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 7a2e89eb01799..daa1811562a38 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -7687,7 +7687,7 @@ SDValue DAGCombiner::MatchRotate(SDValue LHS, SDValue RHS, const SDLoc &DL) {
   };
 
   // TODO: Support pre-legalization funnel-shift by constant.
-  bool IsRotate = LHSShift.getOperand(0) == RHSShift.getOperand(0);
+  bool IsRotate = LHSShiftArg == RHSShiftArg;
   if (!IsRotate && !(HasFSHL || HasFSHR)) {
     if (TLI.isTypeLegal(VT) && LHS.hasOneUse() && RHS.hasOneUse() &&
         ISD::matchBinaryPredicate(LHSShiftAmt, RHSShiftAmt, MatchRotateSum)) {


        


More information about the llvm-commits mailing list