[PATCH] D67188: [InstCombine] sub(xor(x, y), or(x, y)) -> neg(and(x, y))

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 10:37:53 PDT 2019


xbolva00 created this revision.
xbolva00 added a reviewer: lebedev.ri.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

  Name: sub(xor(x, y), or(x, y)) -> neg(and(x, y))
  %or = or i32 %y, %x
  %xor = xor i32 %x, %y
  %sub = sub i32 %xor, %or
    =>
  %sub1 = and i32 %x, %y
  %sub = sub i32 0, %sub1
  
  Optimization: sub(xor(x, y), or(x, y)) -> neg(and(x, y))
  Done: 1
  Optimization is correct!

https://rise4fun.com/Alive/8OI


Repository:
  rL LLVM

https://reviews.llvm.org/D67188

Files:
  lib/Transforms/InstCombine/InstCombineAddSub.cpp
  test/Transforms/InstCombine/sub-xor-or-neg-and.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67188.218746.patch
Type: text/x-patch
Size: 4255 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190904/668aea54/attachment.bin>


More information about the llvm-commits mailing list