llvm-project/llvm/lib/Transforms/Utils
OCHyams e3cd498ff7 [Assignment Tracking][21/*] Account for assignment tracking in inliner
The Assignment Tracking debug-info feature is outlined in this RFC:

https://discourse.llvm.org/t/
rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir

The inliner requires two additions:

fixupAssignments - Update inlined instructions' DIAssignID metadata so that
inlined DIAssignID attachments are unique to the inlined instance.

trackInlinedStores - Treat inlined stores to caller-local variables
(i.e. callee stores to argument pointers that point to the caller's allocas) as
assignments. Track them using trackAssignments, which is the same method as is
used by the AssignmentTrackingPass. This means that we're able to detect stale
memory locations due to DSE after inlining. Because the stores are only tracked
_after_ inlining, any DSE or movement of stores _before_ inlining will not be
accounted for. This is an accepted limitation mentioned in the RFC.

One change is also required:

Update CloneBlock to preserve debug use-before-defs. Otherwise the assignments
will be dropped due to having the intrinsic operands replaced with empty
metadata (see use-before-def.ll in this patch and this related discourse post.

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D133318
2022-11-18 11:55:05 +00:00
..
AMDGPUEmitPrintf.cpp
ASanStackFrameLayout.cpp
AddDiscriminators.cpp [llvm] Don't use Optional::getValue (NFC) 2022-06-20 22:45:45 -07:00
AssumeBundleBuilder.cpp
BasicBlockUtils.cpp [Assignment Tracking][11/*] Update RemoveRedundantDbgInstrs 2022-11-16 12:27:18 +00:00
BreakCriticalEdges.cpp [BasicBlockUtils] Allow critical edge splitting with callbr terminators 2022-07-08 09:20:44 +02:00
BuildLibCalls.cpp [IR] Switch everything to use memory attribute 2022-11-04 10:21:38 +01:00
BypassSlowDivision.cpp
CMakeLists.txt [misexpect] Re-implement MisExpect Diagnostics 2022-04-19 21:23:48 +00:00
CallGraphUpdater.cpp Use PoisonValue instead of UndefValue when RAUWing unreachable code [NFC] 2022-09-10 14:28:01 +01:00
CallPromotionUtils.cpp
CanonicalizeAliases.cpp [llvm] Fix comment typos (NFC) 2022-08-07 00:16:14 -07:00
CanonicalizeFreezeInLoops.cpp
CloneFunction.cpp [Assignment Tracking][21/*] Account for assignment tracking in inliner 2022-11-18 11:55:05 +00:00
CloneModule.cpp
CodeExtractor.cpp [IR] Switch everything to use memory attribute 2022-11-04 10:21:38 +01:00
CodeLayout.cpp Fix compilation of CodeLayout.cpp for MacOS 2022-10-03 21:47:43 +07:00
CodeMoverUtils.cpp [llvm] Qualify auto in range-based for loops (NFC) 2022-08-13 12:55:42 -07:00
CtorUtils.cpp [GlobalOpt] Enable optimization of constructors with different priorities 2022-05-13 22:19:29 +00:00
Debugify.cpp [Debugify][OriginalDIMode] Make HTML reporting infrastructure more resilient 2022-09-29 16:48:06 +02:00
DemoteRegToStack.cpp
EntryExitInstrumenter.cpp [clang][AIX] Fix mcount name and call arguments 2022-10-20 16:20:00 -04:00
EscapeEnumerator.cpp
Evaluator.cpp [Transform] Use range-based for loops (NFC) 2022-08-27 23:54:32 -07:00
FixIrreducible.cpp [Transforms] Qualify auto in range-based for loops (NFC) 2022-08-27 21:21:02 -07:00
FlattenCFG.cpp [Transform] Use range-based for loops (NFC) 2022-08-27 23:54:32 -07:00
FunctionComparator.cpp [llvm] Handle dso_local_equivalent in FunctionComparator 2022-09-22 18:42:31 +00:00
FunctionImportUtils.cpp [Transforms] Qualify auto in range-based for loops (NFC) 2022-08-14 12:51:58 -07:00
GlobalStatus.cpp [GlobalOpt] Perform store->dominated load forwarding for stored once globals 2022-06-24 09:09:26 -07:00
GuardUtils.cpp
HelloWorld.cpp
InjectTLIMappings.cpp
InlineFunction.cpp [Assignment Tracking][21/*] Account for assignment tracking in inliner 2022-11-18 11:55:05 +00:00
InstructionNamer.cpp
IntegerDivision.cpp [IntegerDivision][AMDGPU] Use CreateLogicalOr to block poison propagation. 2022-09-15 09:38:02 -07:00
LCSSA.cpp [LCSSA] Update unreachable uses with poison. 2022-09-04 22:26:18 +01:00
LibCallsShrinkWrap.cpp [iwyu] Move <cmath> out of llvm/Support/MathExtras.h 2022-09-28 20:49:01 +02:00
Local.cpp [Assignment Tracking][12/*] Account for assignment tracking in mem2reg 2022-11-15 11:11:57 +00:00
LoopPeel.cpp [LoopPeeling] Add flag to disable support for peeling loops with non-latch exits 2022-10-25 12:19:14 -07:00
LoopRotationUtils.cpp [LoopRotation] Also drop block dispositions. 2022-10-11 15:25:27 +01:00
LoopSimplify.cpp Revert "reland e5581df60a [SimplifyCFG] accumulate bonus insts cost" 2022-10-25 12:15:39 -04:00
LoopUnroll.cpp [LoopUnroll] Forget exit values when making changes. 2022-10-18 15:12:24 +01:00
LoopUnrollAndJam.cpp [llvm] Don't use Optional::getValue (NFC) 2022-06-20 22:45:45 -07:00
LoopUnrollRuntime.cpp [Transforms] Fix comment typos (NFC) 2022-08-07 23:55:24 -07:00
LoopUtils.cpp [DebugInfo] Fix minor debug info bug in deleteDeadLoop 2022-11-02 13:28:05 +00:00
LoopVersioning.cpp [LoopVersioning,LLE] Clear LoopAccessInfoManager after making changes. 2022-10-04 21:35:42 +01:00
LowerAtomic.cpp [NFC] Switch a few uses of undef to poison as placeholders for unreachable code 2022-07-23 21:50:11 +01:00
LowerGlobalDtors.cpp [Transforms] Qualify auto in range-based for loops (NFC) 2022-08-27 21:21:02 -07:00
LowerInvoke.cpp
LowerMemIntrinsics.cpp [Transforms] Qualify auto in range-based for loops (NFC) 2022-08-27 21:21:02 -07:00
LowerSwitch.cpp LowerSwitch: Avoid inserting NewDefault block 2022-04-14 13:30:56 +08:00
MatrixUtils.cpp [Matrix] Refactor tiled loops in a struct. NFC 2022-07-26 11:02:22 -07:00
Mem2Reg.cpp
MemoryOpRemark.cpp
MemoryTaggingSupport.cpp [MTE] [HWASan] unify isInterestingAlloca 2022-09-28 15:52:34 -07:00
MetaRenamer.cpp [llvm] Use std::size instead of llvm::array_lengthof 2022-09-08 09:01:53 -06:00
MisExpect.cpp [llvm][misexpect] Re-enable MisExpect for SampleProfiling 2022-08-26 20:24:10 +00:00
ModuleUtils.cpp [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07:00
NameAnonGlobals.cpp [LegacyPM] Remove NameAnonGlobalLegacyPass 2022-07-17 14:38:29 -07:00
PredicateInfo.cpp [Transforms] Qualify auto in range-based for loops (NFC) 2022-08-27 21:21:02 -07:00
PromoteMemoryToRegister.cpp [Assignment Tracking][12/*] Account for assignment tracking in mem2reg 2022-11-15 11:11:57 +00:00
RelLookupTableConverter.cpp [RelLookupTableConverter] Bail on invalid pointer size (x32) 2022-08-09 09:36:39 +02:00
SCCPSolver.cpp [SCCP] Add helper for getting constant range (NFC) 2022-11-09 12:42:36 +01:00
SSAUpdater.cpp [NFC] Switch a few uses of undef to poison as placeholders for unreachable code 2022-07-30 13:55:56 +01:00
SSAUpdaterBulk.cpp
SampleProfileInference.cpp [llvm] Use range-based for loops (NFC) 2022-09-03 11:17:40 -07:00
SampleProfileLoaderBaseUtil.cpp Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options 2022-06-05 00:31:44 -07:00
SanitizerStats.cpp
ScalarEvolutionExpander.cpp [SCEVExpander] Forget SCEV when replacing congruent phi. 2022-11-01 17:49:38 +00:00
SimplifyCFG.cpp [Assignment Tracking][15/*] Account for assignment tracking in simplifycfg 2022-11-18 10:15:55 +00:00
SimplifyIndVar.cpp [IndVars] Forget SCEV for value after simplifying condition. 2022-10-21 11:18:01 +01:00
SimplifyLibCalls.cpp [InstCombine] Avoid passing pow attributes to sqrt 2022-11-07 12:07:37 -05:00
SizeOpts.cpp [llvm] Remove unneeded cl::ZeroOrMore for cl::opt options. NFC 2022-06-03 21:59:05 -07:00
SplitModule.cpp [llvm] Qualify auto in range-based for loops (NFC) 2022-08-13 12:55:42 -07:00
StripGCRelocates.cpp [NFC] Rename Instrinsic to Intrinsic 2022-04-25 18:13:23 +01:00
StripNonLineTableDebugInfo.cpp
SymbolRewriter.cpp
UnifyFunctionExitNodes.cpp
UnifyLoopExits.cpp [BasicBlockUtils] Add a new way for CreateControlFlowHub() 2022-10-31 08:58:54 -05:00
Utils.cpp [LegacyPM] Remove NameAnonGlobalLegacyPass 2022-07-17 14:38:29 -07:00
VNCoercion.cpp Take memset_inline into account in analyzeLoadFromClobberingMemInst 2022-10-26 09:50:13 +00:00
ValueMapper.cpp