[PATCH] D152147: [RISCV] Fold binary op into select if profitable.
Mikhail Gudim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 14 09:59:42 PDT 2023
mgudim added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:5846
+ if (Op.hasOneUse() && isBinOp(Op->use_begin()->getOpcode())) {
+ SDNode *BinOp = *Op->use_begin();
----------------
craig.topper wrote:
> Is this safe for division/remainder? The select could be sanitizing inputs. RISC-V doesn't have traps for div/rem, but IR/SelectionDAG semantics consider division by 0 to be immediate UB. Same with (sdiv -1, INT_MIN)
Thanks, I never thought about that.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152147/new/
https://reviews.llvm.org/D152147
More information about the llvm-commits
mailing list