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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 08:21:26 PDT 2022


spatel added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/add_or_sub.ll:83
   %x = mul <4 x i16> %p, %p ; thwart complexity-based canonicalization
   %sub = sub <4 x i16> <i16 -1, i16 poison, i16 poison, i16 -1>, %x
   %or = or <4 x i16> %sub, %x
----------------
marcauberer wrote:
> spatel wrote:
> > Oops - I missed this detail in the pre-commit. Shouldn't the vector constant have zeros rather than -1 to exercise this patch?
> Oh yes, you are right! Is a separate change required for this?
No - it's minor and obvious in hindsight. Just fix it up in this patch.


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