[llvm] e9a86b7 - [DAG] foldBinOpIntoSelect - remove !CanFoldNonConst check. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 04:14:23 PDT 2023


Author: Simon Pilgrim
Date: 2023-03-20T11:14:14Z
New Revision: e9a86b7813aa324f282d66ff711d71f1d0d31492

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

LOG: [DAG] foldBinOpIntoSelect - remove !CanFoldNonConst check. NFC.

These checks are in an if-else chain where CanFoldNonConst is already guaranteed to be false.

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 7667b38c744ca..548da756c01a1 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -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();
   }


        


More information about the llvm-commits mailing list