[DAG] foldBinOpIntoSelect - remove !CanFoldNonConst check. NFC.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 20 Mar 2023 10:20:44 +0000 (10:20 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 20 Mar 2023 11:14:14 +0000 (11:14 +0000)
These checks are in an if-else chain where CanFoldNonConst is already guaranteed to be false.

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 7667b38..548da75 100644 (file)
@@ -2485,15 +2485,13 @@ SDValue DAGCombiner::foldBinOpIntoSelect(SDNode *BO) {
     // CBO, CF + CBO
     NewCT = SelOpNo ? DAG.getNode(BinOpcode, DL, VT, CBO, CT)
                     : DAG.getNode(BinOpcode, DL, VT, CT, CBO);
-    if (!CanFoldNonConst && !NewCT.isUndef() &&
-        !isConstantOrConstantVector(NewCT, true) &&
+    if (!NewCT.isUndef() && !isConstantOrConstantVector(NewCT, true) &&
         !DAG.isConstantFPBuildVectorOrConstantFP(NewCT))
       return SDValue();
 
     NewCF = SelOpNo ? DAG.getNode(BinOpcode, DL, VT, CBO, CF)
                     : DAG.getNode(BinOpcode, DL, VT, CF, CBO);
-    if (!CanFoldNonConst && !NewCF.isUndef() &&
-        !isConstantOrConstantVector(NewCF, true) &&
+    if (!NewCF.isUndef() && !isConstantOrConstantVector(NewCF, true) &&
         !DAG.isConstantFPBuildVectorOrConstantFP(NewCF))
       return SDValue();
   }