[llvm] 54ae4ca - [DAG] visitSRL - pull out ShiftVT. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 12 06:02:36 PDT 2022


Author: Simon Pilgrim
Date: 2022-06-12T14:02:23+01:00
New Revision: 54ae4ca7550a81fd1fa9e484904d553af8fbb2fd

URL: https://github.com/llvm/llvm-project/commit/54ae4ca7550a81fd1fa9e484904d553af8fbb2fd
DIFF: https://github.com/llvm/llvm-project/commit/54ae4ca7550a81fd1fa9e484904d553af8fbb2fd.diff

LOG: [DAG] visitSRL - pull out ShiftVT. 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 f87e129d3b22..ac5cf4a22a46 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -9332,6 +9332,7 @@ SDValue DAGCombiner::visitSRL(SDNode *N) {
     return V;
 
   EVT VT = N0.getValueType();
+  EVT ShiftVT = N1.getValueType();
   unsigned OpSizeInBits = VT.getScalarSizeInBits();
 
   // fold (srl c1, c2) -> c1 >>u c2
@@ -9373,7 +9374,6 @@ SDValue DAGCombiner::visitSRL(SDNode *N) {
     };
     if (ISD::matchBinaryPredicate(N1, N0.getOperand(1), MatchInRange)) {
       SDLoc DL(N);
-      EVT ShiftVT = N1.getValueType();
       SDValue Sum = DAG.getNode(ISD::ADD, DL, ShiftVT, N1, N0.getOperand(1));
       return DAG.getNode(ISD::SRL, DL, VT, N0.getOperand(0), Sum);
     }


        


More information about the llvm-commits mailing list