[PATCH] D98449: [RISCV] Add isel-patterns to optimize (a < 1) into bgez

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 12 08:24:26 PST 2021


jrtc27 accepted this revision.
jrtc27 added a comment.
This revision is now accepted and ready to land.

In D98449#2622341 <https://reviews.llvm.org/D98449#2622341>, @craig.topper wrote:

> In D98449#2621957 <https://reviews.llvm.org/D98449#2621957>, @jrtc27 wrote:
>
>> This feels like it should be a target-independent DAGCombine?
>
> DAG combine and instcombine canonicalize to constants on the RHS and SETGT, SETLT, SETUGT, and SETULT. So X <= 0 will always be rewritten to X< 1.

Ah ok then this looks good to me. Would be good to have the test pre-committed with the worse codegen as usual though.


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

https://reviews.llvm.org/D98449



More information about the llvm-commits mailing list