llvm-project/llvm/lib/Transforms/Scalar
Stephen Tozer 140757bfaa [DebugInfo] Prevent invalid debug info being produced during LoopStrengthReduce
During LoopStrengthReduce, some of the SSA values that are used by debug values
may be lost and/or salvaged. After LSR we attempt to recover any undef debug
values, including any that were salvaged but then lost their values afterwards,
by replacing the lost values with any live equal values (plus a possible
constant offset) that have been gathered prior to running LSR. When we do this
we restore the debug value's original DIExpression, to undo any salvaging (as we
have gone back to using the original debug value).

This process can currently produce invalid debug info if the number of operands
has changed by salvaging during LSR. Replacing old values during the
applyEqualValues step does not change the number of location operands, which
means that when we restore the old DIExpression we may have a mismatch between
the number of operands used by the debug value and the number of operands
referenced by the DIExpression. This patch fixes this by restoring the full
original location metadata at the start of the applyEqualValues step, so that
there is no mismatch in operand count between the debug value and its
DIExpression.

Differential Revision: https://reviews.llvm.org/D98644
2021-04-08 13:04:48 +01:00
..
ADCE.cpp Reapply "[DebugInfo] Handle multiple variable location operands in IR" 2021-03-17 16:45:25 +00:00
AlignmentFromAssumptions.cpp [AssumeBundles] offset should be added to correctly calculate align 2021-04-02 12:32:05 +09:00
AnnotationRemarks.cpp [AnnotationRemarks] Use subprogram location for summary remarks. 2021-03-23 12:05:41 +00:00
BDCE.cpp
CMakeLists.txt
CallSiteSplitting.cpp
ConstantHoisting.cpp [ConstantHoisting] Fix bug where constant materialization could insert into EH pad 2021-02-01 11:23:56 -08:00
ConstraintElimination.cpp [ConstraintElimination] Only strip casts preserving the representation. 2021-03-26 20:07:41 +00:00
CorrelatedValuePropagation.cpp [CVP] Remove -cvp-dont-add-nowrap-flags option 2021-03-07 18:19:31 +01:00
DCE.cpp [Scalar] Use range-based for loops (NFC) 2021-02-25 19:54:38 -08:00
DeadStoreElimination.cpp [DSE] Extending isOverwrite to support offsetted fully overlapping stores 2021-03-10 21:09:33 +01:00
DivRemPairs.cpp
EarlyCSE.cpp Use AssumeInst in a few more places [nfc] 2021-04-06 13:18:53 -07:00
FlattenCFGPass.cpp
Float2Int.cpp
GVN.cpp Plumb AssumeInst through operand bundle apis [nfc] 2021-04-06 12:53:53 -07:00
GVNHoist.cpp
GVNSink.cpp
GuardWidening.cpp
IVUsersPrinter.cpp
IndVarSimplify.cpp [indvars[ Fix pr49802 by checking for SCEVCouldNotCompute 2021-04-01 17:53:44 -07:00
InductiveRangeCheckElimination.cpp [IRCE] Use m_LogicalAnd 2021-03-27 15:23:18 +09:00
InferAddressSpaces.cpp
InstSimplifyPass.cpp
JumpThreading.cpp Make FindAvailableLoadedValue TBAA aware 2021-03-24 17:20:26 +00:00
LICM.cpp Plumb TLI through isSafeToExecuteUnconditionally [NFC] 2021-03-24 17:52:04 -07:00
LoopAccessAnalysisPrinter.cpp
LoopDataPrefetch.cpp
LoopDeletion.cpp
LoopDistribute.cpp
LoopFlatten.cpp LoopFlatten - CanWidenIV - Fix uninitialized variable warnings and use for-range loop. NFCI. 2021-04-06 12:24:20 +01:00
LoopFuse.cpp [LoopFusion] Bails out if only the second candidate is guarded (PR48060) 2021-04-06 01:08:56 +08:00
LoopIdiomRecognize.cpp [LoopIdiomRecognize] Minor cleanups to the FFS idiom matching. NFC 2021-04-07 10:03:14 -07:00
LoopInstSimplify.cpp
LoopInterchange.cpp Revert "[LoopInterchange] Fix transformation bugs in loop interchange" 2021-04-07 21:17:30 -04:00
LoopLoadElimination.cpp [LoopLoadElim] Pass ScalarEvolution in old pass manager. PR49141 2021-02-15 18:08:23 +07:00
LoopPassManager.cpp [NewPM] Verify LoopAnalysisResults after a loop pass 2021-03-19 14:56:37 -07:00
LoopPredication.cpp
LoopRerollPass.cpp [Scalar] Use range-based for loops (NFC) 2021-02-25 19:54:38 -08:00
LoopRotation.cpp
LoopSimplifyCFG.cpp
LoopSink.cpp [llvm] Use set_is_subset (NFC) 2021-02-28 10:59:20 -08:00
LoopStrengthReduce.cpp [DebugInfo] Prevent invalid debug info being produced during LoopStrengthReduce 2021-04-08 13:04:48 +01:00
LoopUnrollAndJamPass.cpp
LoopUnrollPass.cpp NFC: Migrate LoopUnrollPass to work on InstructionCost 2021-02-04 14:05:40 +00:00
LoopUnswitch.cpp Add a subclass of IntrinsicInst for llvm.assume [nfc] 2021-04-06 11:16:22 -07:00
LoopVersioningLICM.cpp
LowerAtomic.cpp
LowerConstantIntrinsics.cpp [LowerConstantIntrinsics] Preserve Dominator Tree, if avaliable 2021-01-30 01:14:50 +03:00
LowerExpectIntrinsic.cpp [TargetTransformInfo] move branch probability query from TargetLoweringInfo 2021-03-22 15:55:34 -04:00
LowerGuardIntrinsic.cpp
LowerMatrixIntrinsics.cpp [TTI] Return a TypeSize from getRegisterBitWidth. 2021-03-24 14:45:13 +00:00
LowerWidenableCondition.cpp
MakeGuardsExplicit.cpp
MemCpyOptimizer.cpp [MemCpyOpt] Add missing MemorySSAWrapperPass dependency macro 2021-03-16 20:30:00 +01:00
MergeICmps.cpp [Transforms/Scalar] Use range-based for loops (NFC) 2021-02-04 21:18:05 -08:00
MergedLoadStoreMotion.cpp
NaryReassociate.cpp [NARY-REASSOCIATE] Support reassociation of min/max 2021-04-02 15:30:13 +07:00
NewGVN.cpp [llvm] Use set_is_subset (NFC) 2021-02-28 10:59:20 -08:00
PartiallyInlineLibCalls.cpp [PartiallyInlineLibCalls] Preserve Dominator Tree, if avaliable 2021-01-29 01:11:36 +03:00
PlaceSafepoints.cpp
Reassociate.cpp [Reassociate] allow or->add with shl operands 2021-02-07 09:45:19 -05:00
Reg2Mem.cpp
RewriteStatepointsForGC.cpp [rs4gc] Use loops instead of straightline code for attribute stripping [nfc] 2021-04-02 09:25:15 -07:00
SCCP.cpp [SCCP] Avoid modifying AdditionalUsers while iterating over it 2021-04-02 19:05:59 +02:00
SROA.cpp [SROA] Allow SROA on pointers with invariant group intrinsic uses 2021-04-05 19:53:40 -07:00
Scalar.cpp
ScalarizeMaskedMemIntrin.cpp Expand masked mem intrinsics correctly wrt big-endian 2021-02-11 08:59:52 +00:00
Scalarizer.cpp
SeparateConstOffsetFromGEP.cpp
SimpleLoopUnswitch.cpp Add a subclass of IntrinsicInst for llvm.assume [nfc] 2021-04-06 11:16:22 -07:00
SimplifyCFGPass.cpp
Sink.cpp
SpeculateAroundPHIs.cpp NFC: Migrate SpeculateAroundPHIs to work on InstructionCost 2021-02-02 13:32:45 +00:00
SpeculativeExecution.cpp Reapply "[DebugInfo] Handle multiple variable location operands in IR" 2021-03-17 16:45:25 +00:00
StraightLineStrengthReduce.cpp [Transforms/Scalar] Use range-based for loops (NFC) 2021-02-04 21:18:05 -08:00
StructurizeCFG.cpp [Scalar] Use range-based for loops (NFC) 2021-02-25 19:54:38 -08:00
TailRecursionElimination.cpp [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of 2021-03-04 11:22:30 -08:00
WarnMissedTransforms.cpp