llvm-project/llvm/test/Transforms
Adrian Prantl 25a7174e7a 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!

llvm-svn: 218778
2014-10-01 17:55:39 +00:00
..
ADCE
AddDiscriminators Move the complex address expression out of DIVariable and into an extra 2014-10-01 17:55:39 +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 Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00
BranchFolding Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call 2014-02-13 14:44:26 +00:00
CodeExtractor
CodeGenPrepare CodeGenPrep: fall back to MVT::Other if instruction's type isn't an EVT. 2014-07-29 10:20:22 +00:00
ConstProp Fix a bug around truncating vector in const prop. 2014-08-21 02:12:35 +00:00
ConstantHoisting [ConstantHoisting][X86] Improve the cost model for small constants with large types (i64 and above). 2014-06-10 00:32:29 +00:00
ConstantMerge Remove the linker_private and linker_private_weak linkages. 2014-03-13 23:18:37 +00:00
CorrelatedValuePropagation
DeadArgElim Move the complex address expression out of DIVariable and into an extra 2014-10-01 17:55:39 +00:00
DeadStoreElimination Move the complex address expression out of DIVariable and into an extra 2014-10-01 17:55:39 +00:00
DebugIR Use right pointer type in DebugIR 2013-09-27 22:26:25 +00:00
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 17:55:39 +00:00
GVN Relax the constraint more in MemoryDependencyAnalysis.cpp 2014-08-29 20:32:58 +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 17:55:39 +00:00
IPConstantProp No need for those tests to go thru llvm-as and/or llvm-dis. 2014-05-27 22:03:28 +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 17:55:39 +00:00
InstCombine Move the complex address expression out of DIVariable and into an extra 2014-10-01 17:55:39 +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
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 17:55:39 +00:00
LoadCombine Add LoadCombine pass. 2014-05-29 01:55:07 +00:00
LoopDeletion
LoopIdiom Move the complex address expression out of DIVariable and into an extra 2014-10-01 17:55:39 +00:00
LoopReroll Fix loop rerolling pass failure with non-consant loop lower bound 2014-01-03 17:20:01 +00:00
LoopRotate Move the complex address expression out of DIVariable and into an extra 2014-10-01 17:55:39 +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 17:55:39 +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 17:55:39 +00:00
LowerAtomic IR: add "cmpxchg weak" variant to support permitted failure. 2014-06-13 14:24:07 +00:00
LowerExpectIntrinsic Lower llvm.expect intrinsic correctly for i1 2014-02-02 22:43:55 +00:00
LowerInvoke Remove LowerInvoke's obsolete "-enable-correct-eh-support" option 2014-03-20 19:54:47 +00:00
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 17:55:39 +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 17:55:39 +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
SCCP SCCP: update for cmpxchg returning { iN, i1 } now. 2014-06-13 14:54:09 +00:00
SLPVectorizer Move the complex address expression out of DIVariable and into an extra 2014-10-01 17:55:39 +00:00
SROA SROA: Don't insert instructions before a PHI 2014-09-01 21:20:14 +00:00
SampleProfile Move the complex address expression out of DIVariable and into an extra 2014-10-01 17:55:39 +00:00
ScalarRepl Move the complex address expression out of DIVariable and into an extra 2014-10-01 17:55:39 +00:00
Scalarizer Move the complex address expression out of DIVariable and into an extra 2014-10-01 17:55:39 +00:00
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 17:55:39 +00:00
Sink Sink: Don't sink static allocas from the entry block 2014-03-21 15:51:51 +00:00
StripSymbols Move the complex address expression out of DIVariable and into an extra 2014-10-01 17:55:39 +00:00
StructurizeCFG StructurizeCFG: Fix verification failure with some loops. 2013-11-22 19:24:39 +00:00
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 Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00
Util utils: Fix segfault in flattencfg 2014-08-13 20:31:53 +00:00