aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Scalar/JumpThreading.cpp
diff options
context:
space:
mode:
authorOrlando Cazalet-Hyams <orlando.hyams@sony.com>2024-02-20 16:00:55 +0000
committerGitHub <noreply@github.com>2024-02-20 16:00:55 +0000
commitababa964752d5bfa6eb608c97f19d4e68df1d243 (patch)
tree26b6cb86bafab688a348e950479323949092e568 /llvm/lib/Transforms/Scalar/JumpThreading.cpp
parent8f7ae64ea108de54d9aad963c55e1aef7dc62b86 (diff)
downloadllvm-ababa964752d5bfa6eb608c97f19d4e68df1d243.zip
llvm-ababa964752d5bfa6eb608c97f19d4e68df1d243.tar.gz
llvm-ababa964752d5bfa6eb608c97f19d4e68df1d243.tar.bz2
[RemoveDIs][NFC] Introduce DbgRecord base class [1/3] (#78252)
Patch 1 of 3 to add llvm.dbg.label support to the RemoveDIs project. The patch stack adds a new base class -> 1. Add DbgRecord base class for DPValue and the not-yet-added DPLabel class. 2. Add the DPLabel class. 3. Enable dbg.label conversion and add support to passes. Patches 1 and 2 are NFC. In the near future we also will rename DPValue to DbgVariableRecord and DPLabel to DbgLabelRecord, at which point we'll overhaul the function names too. The name DPLabel keeps things consistent for now.
Diffstat (limited to 'llvm/lib/Transforms/Scalar/JumpThreading.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/JumpThreading.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
index bb33a5d..5816bf2 100644
--- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -401,7 +401,7 @@ static bool replaceFoldableUses(Instruction *Cond, Value *ToVal,
Changed |= replaceNonLocalUsesWith(Cond, ToVal);
for (Instruction &I : reverse(*KnownAtEndOfBB)) {
// Replace any debug-info record users of Cond with ToVal.
- for (DPValue &DPV : I.getDbgValueRange())
+ for (DPValue &DPV : DPValue::filter(I.getDbgValueRange()))
DPV.replaceVariableLocationOp(Cond, ToVal, true);
// Reached the Cond whose uses we are trying to replace, so there are no
@@ -2082,7 +2082,7 @@ JumpThreadingPass::cloneInstructions(BasicBlock::iterator BI,
auto CloneAndRemapDbgInfo = [&](Instruction *NewInst, Instruction *From) {
auto DPVRange = NewInst->cloneDebugInfoFrom(From);
- for (DPValue &DPV : DPVRange)
+ for (DPValue &DPV : DPValue::filter(DPVRange))
RetargetDPValueIfPossible(&DPV);
};
@@ -2117,7 +2117,7 @@ JumpThreadingPass::cloneInstructions(BasicBlock::iterator BI,
DPMarker *Marker = RangeBB->getMarker(BE);
DPMarker *EndMarker = NewBB->createMarker(NewBB->end());
auto DPVRange = EndMarker->cloneDebugInfoFrom(Marker, std::nullopt);
- for (DPValue &DPV : DPVRange)
+ for (DPValue &DPV : DPValue::filter(DPVRange))
RetargetDPValueIfPossible(&DPV);
}