llvm-project/llvm/test/Transforms/Mem2Reg
Bjorn Pettersson 550517bcab Improve ConvertDebugDeclareToDebugValue
Summary:
This is a follow-up to r334830 and r335031.

In the valueCoversEntireFragment check we now also handle
the situation when there is a variable length array (VLA)
involved, and the length of the array has been reduced to
a constant.

The ConvertDebugDeclareToDebugValue functions that are related
to PHI nodes and load instructions now avoid inserting dbg.value
intrinsics when the value does not, for certain, cover the
variable/fragment that should be described.
In r334830 we assumed that the value always covered the entire
var/fragment and we had assertions in the code to show that
assumption. However, those asserts failed when compiling code
with VLAs, so we removed the asserts in r335031. Now when we
know that the valueCoversEntireFragment check can fail also for
PHI/Load instructions we avoid to insert the faulty dbg.value
intrinsic in such situations. Compared to the Store instruction
scenario we simply drop the dbg.value here (as the variable does
not change its value due to PHI/Load, so an earlier dbg.value
describing the variable should still be valid).

Reviewers: aprantl, vsk, efriedma

Reviewed By: aprantl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D48547

llvm-svn: 335580
2018-06-26 06:17:00 +00:00
..
2002-03-28-UninitializedVal.ll
2002-05-01-ShouldNotPromoteThisAlloca.ll
2003-04-10-DFNotFound.ll
2003-04-18-DeadBlockProblem.ll
2003-04-24-MultipleIdenticalSuccessors.ll
2003-06-26-IterativePromote.ll
2003-10-05-DeadPHIInsertion.ll
2005-06-30-ReadBeforeWrite.ll
2005-11-28-Crash.ll
2007-08-27-VolatileLoadsStores.ll
ConvertDebugInfo.ll
ConvertDebugInfo2.ll
PromoteMemToRegister.ll [Debugify] Avoid printing unnecessary square braces, NFC 2018-05-24 23:00:22 +00:00
UndefValuesMerge.ll
atomic.ll
crash.ll
dbg-addr-inline-dse.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
dbg-addr.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
dbg-inline-scope-for-phi.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
debug-alloca-phi-2.ll Re-apply "[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue" 2018-06-15 13:48:55 +00:00
debug-alloca-phi.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
debug-alloca-vla-1.ll Improve ConvertDebugDeclareToDebugValue 2018-06-26 06:17:00 +00:00
debug-alloca-vla-2.ll Improve ConvertDebugDeclareToDebugValue 2018-06-26 06:17:00 +00:00
ignore-lifetime.ll
optnone.ll
pr24179.ll
pr37632-unreachable-list-of-stores.ll [Mem2Reg] Avoid replacing load with itself in promoteSingleBlockAlloca. 2018-06-07 11:09:05 +00:00
preserve-nonnull-load-metadata.ll