[PATCH] [Reassociate] Similar to "X + -X" -> "0", added code to handle "X + ~X" -> "-1".

Rahul Jain rahul1.jain at samsung.com
Tue May 20 00:36:50 PDT 2014


Hi bkramer, rafael, majnemer,


Handle "X + ~X" -> "-1" in the function Value *Reassociate::OptimizeAdd(Instruction *I, SmallVectorImpl<ValueEntry> &Ops);
This patch implements:
TODO: We could handle "X + ~X" -> "-1" if we wanted, since "-X = ~X+1".

http://reviews.llvm.org/D3835

Files:
  lib/Transforms/Scalar/Reassociate.cpp
  test/Transforms/Reassociate/inverses.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3835.9596.patch
Type: text/x-patch
Size: 4312 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140520/e3a77262/attachment.bin>


More information about the llvm-commits mailing list