[PATCH] D152147: [RISCV] Fold binary op into select if profitable.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 15:54:34 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:5527
+                                                  {ConstBinOp, ConstSelOp});
+  APInt NewConstAPInt = dyn_cast<ConstantSDNode>(NewConstOp)->getAPIntValue();
+  if (!NewConstAPInt.isZero() && !NewConstAPInt.isAllOnes())
----------------
dyn_cast->cast if it can't fail


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:5527
+                                                  {ConstBinOp, ConstSelOp});
+  APInt NewConstAPInt = dyn_cast<ConstantSDNode>(NewConstOp)->getAPIntValue();
+  if (!NewConstAPInt.isZero() && !NewConstAPInt.isAllOnes())
----------------
craig.topper wrote:
> dyn_cast->cast if it can't fail
const APInt &


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152147/new/

https://reviews.llvm.org/D152147



More information about the llvm-commits mailing list