llvm-6502/lib/Transforms
Matthias Braun af2e236c11 InstCombineSimplifyDemanded: Remove nsw/nuw flags when optimizing demanded bits
When optimizing demanded bits of the operands of an Add we have to
remove the nsw/nuw flags as we have no guarantee anymore that we don't
wrap.  This is legal here because the top bit is not demanded.  In fact
this operaion was already performed but missed in the case of an Add
with a constant on the right side.  To fix this this patch refactors the
code to unify the code paths in SimplifyDemandedUseBits() handling of
Add/Sub:

- The transformation of Add->Or is removed from the simplify demand
  code because the equivalent transformation exists in
  InstCombiner::visitAdd()
- KnownOnes/KnownZero are not adjusted for Add x, C anymore as
  computeKnownBits() already performs these computations.
- The simplification of the operands is unified. In this new version
  constant on the right side of a Sub are shrunk now as I could not find
  a reason why not to do so.
- The special case for clearing nsw/nuw in ShrinkDemandedConstant() is
  not necessary anymore as the caller does that already.

Differential Revision: http://reviews.llvm.org/D9415

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236269 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-30 22:05:30 +00:00
..
Hello
InstCombine InstCombineSimplifyDemanded: Remove nsw/nuw flags when optimizing demanded bits 2015-04-30 22:05:30 +00:00
Instrumentation IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
IPO [opaque pointer type] Pass GlobalAlias the actual pointer type rather than decomposing it into pointee type + address space 2015-04-29 21:22:39 +00:00
ObjCARC Remove empty non-virtual destructors or mark them =default when non-public 2015-04-11 15:32:26 +00:00
Scalar IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
Utils [opaque pointer type] Store the value type of an alloca 2015-04-29 23:00:35 +00:00
Vectorize Fix a couple of typos in comments. 2015-04-24 00:10:27 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile