[PATCH] D133362: [InstCombine] Fold x + (x | -x) to x & (x - 1)

Marc Auberer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 14:22:01 PDT 2022


marcauberer added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/add_or_sub.ll:154
   %or = or i10 %sub, %x
   %add = add nsw nuw i10 %or, %x
   ret i10 %add
----------------
spatel wrote:
> Can we propagate the no-wrap flags to the new add (ie, is it correct based on Alive2 proofs)?
Do we need to propagate the no-wrap flags?

Without propagating the flags: https://alive2.llvm.org/ce/z/3rM4KF
With propagating the flags: https://alive2.llvm.org/ce/z/tWyFm7


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133362



More information about the llvm-commits mailing list