[llvm] [RISCV] Add a check in lowerSELECT after foldBinOpIntoSelectIfProfitable (PR #97391)

Mikhail Gudim via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 07:52:45 PDT 2024


================
@@ -7664,7 +7664,10 @@ SDValue RISCVTargetLowering::lowerSELECT(SDValue Op, SelectionDAG &DAG) const {
       if (SDValue NewSel = foldBinOpIntoSelectIfProfitable(*Op->use_begin(),
                                                            DAG, Subtarget)) {
         DAG.ReplaceAllUsesWith(BinOp, &NewSel);
-        return lowerSELECT(NewSel, DAG);
----------------
mgudim wrote:

Can you please add a comment explaining why the check is needed - it doesn't seem obvious.

https://github.com/llvm/llvm-project/pull/97391


More information about the llvm-commits mailing list