[PATCH] D155328: [RISCV] Add a DAG combine for (czero_eq X, (xor Y, 1)) -> (czero_ne X, Y) if Y is 0 or 1.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 14 14:31:32 PDT 2023


craig.topper added a comment.

In D155328#4502274 <https://reviews.llvm.org/D155328#4502274>, @mgudim wrote:

> LGTM, but it seems weird to me that we have to re-implement such basic optimisations instead of generic code doing this.  @craig.topper @asb I know I asked this is the call, but I still don't understand why we emit target-specific node for SELECT so early?

There isn’t a generic combine for this on select after type legalization. It depends on getBooleanContents to know the value for true. So I think it only exists for i1.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155328



More information about the llvm-commits mailing list