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

Mikhail Gudim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 13:53:30 PDT 2023


mgudim updated this revision to Diff 529033.
mgudim added a comment.

Addressed comments.
Fixed a bug: the constants were passed to `DAG.FoldConstantArithmetic` in the wrong order.
Moved call to `foldBinOpIntoSelectIfProfitable` after `combineSelectToBinOp` - this way we will not fold binop if the constant of select is already `0` or `-1`.
Minor typo fixes.


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

https://reviews.llvm.org/D152147

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/fold-binop-into-select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152147.529033.patch
Type: text/x-patch
Size: 4383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230606/5939a10a/attachment.bin>


More information about the llvm-commits mailing list