Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | ||
---|---|---|
2541 | Might be better to pass ISD::SUB or ISD::ADD from the caller instead of re-inspecting the opcode. |
Comment Actions
LGTM - as noted in 21d7c3bcc646f5db73b, this pattern is probably not common because it's not the canonical IR.
A more interesting case is where the mul is operand 0 of the sub. We would not transform that in IR because it needs a negation, but removing the multiply looks better on several targets (RISCV, AArch64, x86). It's probably a win for any target where multiply is slower than the fastest ALU op, and we're not optimizing strictly for size.
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | ||
---|---|---|
2557 | Leave off the inner-most braces to be consistent with the existing code. |
Might be better to pass ISD::SUB or ISD::ADD from the caller instead of re-inspecting the opcode.