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 [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
AddDiscriminators IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
AlignmentFromAssumptions [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
ArgumentPromotion IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
AtomicExpand/ARM Use target-dependent emitLeading/TrailingFence instead of the target-independent insertLeading/TrailingFence (in AtomicExpandPass) 2014-09-03 21:01:03 +00:00
BBVectorize [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
BDCE [BDCE] Don't forget uses of root instructions seen before the instruction itself 2015-02-18 03:12:28 +00:00
BranchFolding Delete -std-compile-opts. 2014-10-16 20:00:02 +00:00
CodeExtractor [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
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 [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
ConstProp Constfold insertelement to undef when index is out-of-bounds 2015-04-27 09:30:49 +00:00
CorrelatedValuePropagation [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
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 [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
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 [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
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 [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
IPConstantProp Skip extra LLVM IR assemble/disassemble steps in some tests 2015-04-24 18:06:09 +00:00
IRCE [IRCE] Fix a regression introduced in r232444. 2015-03-24 19:29:18 +00:00
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 [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
LoopDeletion [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
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 [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
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 [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
LowerBitSets LowerBitSets: Avoid reusing byte set addresses. 2015-03-19 22:02:10 +00:00
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 [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
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 [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
MetaRenamer [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
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 PartiallyInlineLibCalls: Check sqrt result type before transforming it. 2014-08-01 23:21:21 +00:00
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 Fix invalid LLVM IR in PruneEH tests 2015-02-11 02:06:47 +00:00
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 [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
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 [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
TailCallElim TRE: Just erase dead BBs and tweak the iteration loop not to increment the deleted BB iterator. 2015-02-28 16:47:27 +00:00
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 [SwitchLowering] Remove incoming values in the reverse order 2015-03-17 18:03:10 +00:00