[PATCH] D154126: [InstCombine] Transform (A > 0) | (A < 0) -> zext (A != 0) fold

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 11:40:17 PDT 2023


goldstein.w.n added a comment.

Thank you for the patch and welcome!

We actually seem to handle this as long as its `(zext (or slt, sgt))`: https://alive2.llvm.org/ce/z/Fpyw7G
Its only if we have `(or (zext slt), (zext sgt))` that we fail.

I think the best approach we actually be to fold:`(bitwise_logic (zext A), (zext B))` -> `(zext (bitwise_logic A, B))`. That will cover this case any may help other cases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154126



More information about the llvm-commits mailing list