diff options
author | Orlando Cazalet-Hyams <orlando.hyams@sony.com> | 2024-02-20 16:00:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 16:00:55 +0000 |
commit | ababa964752d5bfa6eb608c97f19d4e68df1d243 (patch) | |
tree | 26b6cb86bafab688a348e950479323949092e568 /llvm/lib/Transforms/Utils/LoopRotationUtils.cpp | |
parent | 8f7ae64ea108de54d9aad963c55e1aef7dc62b86 (diff) | |
download | llvm-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/Utils/LoopRotationUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopRotationUtils.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp index ec59a07..b12c1b9 100644 --- a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp @@ -554,7 +554,7 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) { DbgIntrinsics.insert(makeHash(DII)); // Until RemoveDIs supports dbg.declares in DPValue format, we'll need // to collect DPValues attached to any other debug intrinsics. - for (const DPValue &DPV : DII->getDbgValueRange()) + for (const DPValue &DPV : DPValue::filter(DII->getDbgValueRange())) DbgIntrinsics.insert(makeHash(&DPV)); } else { break; @@ -564,7 +564,7 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) { // Build DPValue hashes for DPValues attached to the terminator, which isn't // considered in the loop above. for (const DPValue &DPV : - OrigPreheader->getTerminator()->getDbgValueRange()) + DPValue::filter(OrigPreheader->getTerminator()->getDbgValueRange())) DbgIntrinsics.insert(makeHash(&DPV)); // Remember the local noalias scope declarations in the header. After the @@ -621,7 +621,8 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) { RemapDPValueRange(M, DbgValueRange, ValueMap, RF_NoModuleLevelChanges | RF_IgnoreMissingLocals); // Erase anything we've seen before. - for (DPValue &DPV : make_early_inc_range(DbgValueRange)) + for (DPValue &DPV : + make_early_inc_range(DPValue::filter(DbgValueRange))) if (DbgIntrinsics.count(makeHash(&DPV))) DPV.eraseFromParent(); } @@ -647,7 +648,7 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) { RF_NoModuleLevelChanges | RF_IgnoreMissingLocals); NextDbgInsts = DPMarker::getEmptyDPValueRange(); // Erase anything we've seen before. - for (DPValue &DPV : make_early_inc_range(Range)) + for (DPValue &DPV : make_early_inc_range(DPValue::filter(Range))) if (DbgIntrinsics.count(makeHash(&DPV))) DPV.eraseFromParent(); } |