Skip to content

Commit c792884

Browse files
author
Chris Jackson
committed
[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]
Reland 3f2b76e with the test corrected to require x86-registered-target. Differential Revision: https://reviews.llvm.org/D120169
1 parent ddfffbe commit c792884

File tree

4 files changed

+469
-91
lines changed

4 files changed

+469
-91
lines changed

llvm/include/llvm/Analysis/ScalarEvolution.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,10 @@ class ScalarEvolution {
545545
/// Return true if the SCEV expression contains an undef value.
546546
bool containsUndefs(const SCEV *S) const;
547547

548+
/// Return true if the SCEV expression contains a Value that has been
549+
/// optimised out and is now a nullptr.
550+
bool containsErasedValue(const SCEV *S) const;
551+
548552
/// Return a SCEV expression for the full generality of the specified
549553
/// expression.
550554
const SCEV *getSCEV(Value *V);

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12688,6 +12688,15 @@ bool ScalarEvolution::containsUndefs(const SCEV *S) const {
1268812688
});
1268912689
}
1269012690

12691+
// Return true when S contains a value that is a nullptr.
12692+
bool ScalarEvolution::containsErasedValue(const SCEV *S) const {
12693+
return SCEVExprContains(S, [](const SCEV *S) {
12694+
if (const auto *SU = dyn_cast<SCEVUnknown>(S))
12695+
return SU->getValue() == nullptr;
12696+
return false;
12697+
});
12698+
}
12699+
1269112700
/// Return the size of an element read or written by Inst.
1269212701
const SCEV *ScalarEvolution::getElementSize(Instruction *Inst) {
1269312702
Type *Ty;

0 commit comments

Comments
 (0)