[PATCH] D142783: [InstCombine][LV][WIP] Fold (add (zext (add X, -1)), 1) -> (zext X) if X is non-zero.
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 30 12:31:57 PST 2023
spatel added a comment.
In D142783#4091597 <https://reviews.llvm.org/D142783#4091597>, @craig.topper wrote:
> Should I proceed with this patch?
Seems ok to me. Add an alive link to the patch description:
https://alive2.llvm.org/ce/z/NsRDwX
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp:979
+ // Fold (add (zext (add X, -1)), 1) -> (zext X) if X is non-zero.
+ // FIXME: There's a general form for any constant on the outer add.
+ if (C->isOne()) {
----------------
FIXME -> TODO
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142783/new/
https://reviews.llvm.org/D142783
More information about the llvm-commits
mailing list