[PATCH] D115755: [InstSimplify] Fold logic And to Zero

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 15 09:20:45 PST 2021


rampitec added inline comments.


================
Comment at: llvm/test/Transforms/InstSimplify/and.ll:168
   %or = or i71 %x, %y
   %xor1 = xor i71 %x, %or
   %xor2 = xor i71 %y, %or
----------------
spatel wrote:
> rampitec wrote:
> > 'or' is more complex than the argument, the xor will be commuted.
> > See InstCombiner::getComplexity() for the details. Search for "thwart complexity-based canonicalization" in the llvm/test/Transforms/InstCombine directory for test coverage that works around it.
> This is instsimplify, so we don't have to worry about the pass itself altering the input (this is shown in the baseline CHECK lines).
Ok, thanks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115755



More information about the llvm-commits mailing list