From e9a86b7813aa324f282d66ff711d71f1d0d31492 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 20 Mar 2023 10:20:44 +0000 Subject: [PATCH] [DAG] foldBinOpIntoSelect - remove !CanFoldNonConst check. NFC. These checks are in an if-else chain where CanFoldNonConst is already guaranteed to be false. --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 7667b38..548da75 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(); } -- 2.7.4