[llvm] 5377abc - [DAG] matchRotateHalf - constify SelectionDAG arg. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 02:57:52 PDT 2022


Author: Simon Pilgrim
Date: 2022-08-24T10:57:38+01:00
New Revision: 5377abcde2409dc066b4b9e3425900df1eff927e

URL: https://github.com/llvm/llvm-project/commit/5377abcde2409dc066b4b9e3425900df1eff927e
DIFF: https://github.com/llvm/llvm-project/commit/5377abcde2409dc066b4b9e3425900df1eff927e.diff

LOG: [DAG] matchRotateHalf - constify SelectionDAG arg. NFC.

Based off Issue #57283 - we need to try harder to ensure we're not creating nodes on-the-fly - so make sure we're just using SelectionDAG for analysis where possible

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 752d02ba07cfa..b1d6b3e11d69c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -7183,7 +7183,8 @@ SDValue DAGCombiner::visitOR(SDNode *N) {
   return SDValue();
 }
 
-static SDValue stripConstantMask(SelectionDAG &DAG, SDValue Op, SDValue &Mask) {
+static SDValue stripConstantMask(const SelectionDAG &DAG, SDValue Op,
+                                 SDValue &Mask) {
   if (Op.getOpcode() == ISD::AND &&
       DAG.isConstantIntBuildVectorOrConstantInt(Op.getOperand(1))) {
     Mask = Op.getOperand(1);
@@ -7193,7 +7194,7 @@ static SDValue stripConstantMask(SelectionDAG &DAG, SDValue Op, SDValue &Mask) {
 }
 
 /// Match "(X shl/srl V1) & V2" where V2 may not be present.
-static bool matchRotateHalf(SelectionDAG &DAG, SDValue Op, SDValue &Shift,
+static bool matchRotateHalf(const SelectionDAG &DAG, SDValue Op, SDValue &Shift,
                             SDValue &Mask) {
   Op = stripConstantMask(DAG, Op, Mask);
   if (Op.getOpcode() == ISD::SRL || Op.getOpcode() == ISD::SHL) {


        


More information about the llvm-commits mailing list