llvm-6502/test/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
..
ADCE
AddDiscriminators IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
AlignmentFromAssumptions
ArgumentPromotion IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
AtomicExpand/ARM
BBVectorize
BDCE
BranchFolding
CodeExtractor
CodeGenPrepare [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
ConstantHoisting [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
ConstantMerge
ConstProp Constfold insertelement to undef when index is out-of-bounds 2015-04-27 09:30:49 +00:00
CorrelatedValuePropagation
DeadArgElim IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
DeadStoreElimination IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
EarlyCSE
Float2Int Reapply r233175 and r233183: float2int. 2015-03-27 10:36:57 +00:00
FunctionAttrs [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
GCOVProfiling IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
GlobalDCE [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
GlobalOpt IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
GVN [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
IndVarSimplify [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
Inline IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
InstCombine InstCombineSimplifyDemanded: Remove nsw/nuw flags when optimizing demanded bits 2015-04-30 22:05:30 +00:00
InstMerge
InstSimplify [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
Internalize
IPConstantProp Skip extra LLVM IR assemble/disassemble steps in some tests 2015-04-24 18:06:09 +00:00
IRCE
JumpThreading [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
LCSSA [opaque pointer type] Add textual IR support for explicit type parameter to the invoke instruction 2015-04-24 19:32:54 +00:00
LICM IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
LoadCombine
LoopDeletion
LoopIdiom IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
LoopInterchange Add support to interchange loops with reductions. 2015-04-23 04:51:44 +00:00
LoopReroll
LoopRotate IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
LoopSimplify Verifier: Call verifyModule() from llc and opt 2015-03-27 22:04:28 +00:00
LoopStrengthReduce IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
LoopUnroll [LoopUnrollRuntime] Avoid high-cost trip count computation. 2015-04-14 03:20:38 +00:00
LoopUnswitch [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
LoopVectorize IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
LowerAtomic
LowerBitSets
LowerExpectIntrinsic [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
LowerInvoke Verifier: Call verifyModule() from llc and opt 2015-03-27 22:04:28 +00:00
LowerSwitch
Mem2Reg IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
MemCpyOpt [MemCpyOpt] Use the raw i8* dest when optimizing memset+memcpy. 2015-04-21 21:28:33 +00:00
MergeFunc
MetaRenamer
NaryReassociate Resurrect r235688 2015-04-24 04:22:39 +00:00
ObjCARC IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
PartiallyInlineLibCalls
PhaseOrdering [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
PlaceSafepoints Don't Place Entry Safepoints Before the llvm.frameescape() Intrinsic 2015-04-26 19:41:23 +00:00
PruneEH
Reassociate [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
Reg2Mem
RewriteStatepointsForGC [RewriteStatepointsForGC] Exclude constant values from being considered live at a safepoint 2015-04-26 19:48:03 +00:00
SampleProfile IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
Scalarizer IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
ScalarRepl IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
SCCP [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
SeparateConstOffsetFromGEP/NVPTX [SeparateConstOffsetFromGEP] garbage-collect intermediate instructions 2015-04-21 19:53:18 +00:00
SimplifyCFG IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
Sink
SLPVectorizer IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
SROA [ConstantFold] Don't fold ppc_fp128 <-> int bitcasts 2015-03-28 16:44:57 +00:00
StraightLineStrengthReduce [NVPTX] run SeparateConstOffsetFromGEP before SLSR 2015-04-23 20:00:04 +00:00
StripSymbols IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
StructurizeCFG
TailCallElim
TailDup [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
Util