llvm-6502/test/Transforms
Adrian Prantl 02474a32eb Move the complex address expression out of DIVariable and into an extra
argument of the llvm.dbg.declare/llvm.dbg.value intrinsics.

Previously, DIVariable was a variable-length field that has an optional
reference to a Metadata array consisting of a variable number of
complex address expressions. In the case of OpPiece expressions this is
wasting a lot of storage in IR, because when an aggregate type is, e.g.,
SROA'd into all of its n individual members, the IR will contain n copies
of the DIVariable, all alike, only differing in the complex address
reference at the end.

By making the complex address into an extra argument of the
dbg.value/dbg.declare intrinsics, all of the pieces can reference the
same variable and the complex address expressions can be uniqued across
the CU, too.
Down the road, this will allow us to move other flags, such as
"indirection" out of the DIVariable, too.

The new intrinsics look like this:
declare void @llvm.dbg.declare(metadata %storage, metadata %var, metadata %expr)
declare void @llvm.dbg.value(metadata %storage, i64 %offset, metadata %var, metadata %expr)

This patch adds a new LLVM-local tag to DIExpressions, so we can detect
and pretty-print DIExpression metadata nodes.

What this patch doesn't do:

This patch does not touch the "Indirect" field in DIVariable; but moving
that into the expression would be a natural next step.

http://reviews.llvm.org/D4919
rdar://problem/17994491

Thanks to dblaikie and dexonsmith for reviewing this patch!

Note: I accidentally committed a bogus older version of this patch previously.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218787 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-01 18:55:02 +00:00
..
ADCE
AddDiscriminators Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
AlignmentFromAssumptions [AlignmentFromAssumptions] Don't crash just because the target is 32-bit 2014-09-11 08:40:17 +00:00
ArgumentPromotion Don't promote byval pointer arguments when padding matters 2014-08-28 22:42:00 +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
BranchFolding
CodeExtractor
CodeGenPrepare CodeGenPrep: fall back to MVT::Other if instruction's type isn't an EVT. 2014-07-29 10:20:22 +00:00
ConstantHoisting
ConstantMerge
ConstProp Fix a bug around truncating vector in const prop. 2014-08-21 02:12:35 +00:00
CorrelatedValuePropagation
DeadArgElim Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
DeadStoreElimination Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
DebugIR
EarlyCSE
FunctionAttrs [optnone] Make the optnone attribute effective at suppressing function 2014-08-13 10:49:33 +00:00
GCOVProfiling Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
GlobalDCE Remove dangling initializers in GlobalDCE 2014-08-25 17:51:14 +00:00
GlobalOpt Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
GVN Relax the constraint more in MemoryDependencyAnalysis.cpp 2014-08-29 20:32:58 +00:00
IndVarSimplify [IndVarSimplify] Widen loop unsigned compares. 2014-09-30 03:17:42 +00:00
Inline Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
InstCombine Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
InstMerge MergedLoadStoreMotion pass 2014-07-18 19:13:09 +00:00
InstSimplify InstSimplify: Don't allow (x srem y) urem y -> x srem y 2014-09-17 04:16:35 +00:00
Internalize Use "weak alias" instead of "alias weak" 2014-07-30 22:51:54 +00:00
IPConstantProp
JumpThreading Make use of @llvm.assume from LazyValueInfo 2014-09-07 20:29:59 +00:00
LCSSA
LICM Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
LoadCombine
LoopDeletion
LoopIdiom Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
LoopReroll
LoopRotate Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
LoopSimplify FileCheckize. NFC. 2014-09-12 17:55:16 +00:00
LoopStrengthReduce Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
LoopUnroll Use a loop to simplify the runtime unrolling prologue. 2014-09-29 11:15:00 +00:00
LoopUnswitch
LoopVectorize Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
LowerAtomic
LowerExpectIntrinsic
LowerInvoke
LowerSwitch Added test for commit r212802 that was missing 2014-07-11 10:36:00 +00:00
Mem2Reg Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
MemCpyOpt Fix a really bad miscompile introduced in r216865 - the else-if logic 2014-09-01 10:09:18 +00:00
MergeFunc Fix crash when looking up the addrspace of GEPs with vector types 2014-09-02 18:47:54 +00:00
MetaRenamer Use "weak alias" instead of "alias weak" 2014-07-30 22:51:54 +00:00
ObjCARC Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
PartiallyInlineLibCalls PartiallyInlineLibCalls: Check sqrt result type before transforming it. 2014-08-01 23:21:21 +00:00
PhaseOrdering
PruneEH
Reassociate Reassociate x + -0.1234 * y into x - 0.1234 * y 2014-08-21 10:45:30 +00:00
Reg2Mem
SampleProfile Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
Scalarizer Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
ScalarRepl Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
SCCP
SeparateConstOffsetFromGEP/NVPTX Partially revert r210444 due to performance regression 2014-07-16 23:25:00 +00:00
SimplifyCFG Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
Sink
SLPVectorizer Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
SROA SROA: Don't insert instructions before a PHI 2014-09-01 21:20:14 +00:00
StripSymbols Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
StructurizeCFG
TailCallElim We may visit a call that uses an alloca multiple times in callUsesLocalStack, sometimes with IsNocapture true and sometimes with IsNocapture false. We accidentally skipped work we needed to do in the IsNocapture=false case if we were called with IsNocapture=true the first time. Fixes PR20405! 2014-07-23 06:24:49 +00:00
TailDup
Util utils: Fix segfault in flattencfg 2014-08-13 20:31:53 +00:00