diff options
author | OCHyams <orlando.hyams@sony.com> | 2022-10-20 15:40:14 +0100 |
---|---|---|
committer | OCHyams <orlando.hyams@sony.com> | 2022-11-02 13:28:05 +0000 |
commit | 88d34d46260e62ee4640b4fa50d3f3e70c75f198 (patch) | |
tree | 13be0af403c782106de1bce11c1ed9a72db4a5f8 /llvm/lib/Transforms/Utils/LoopUtils.cpp | |
parent | 5fe9273c73969791795e5302933abadc9f33f09a (diff) | |
download | llvm-88d34d46260e62ee4640b4fa50d3f3e70c75f198.zip llvm-88d34d46260e62ee4640b4fa50d3f3e70c75f198.tar.gz llvm-88d34d46260e62ee4640b4fa50d3f3e70c75f198.tar.bz2 |
[DebugInfo] Fix minor debug info bug in deleteDeadLoop
Using a DebugVariable as the set key rather than std::pair<DIVariable *,
DIExpression *> ensures we don't accidently confuse multiple instances of
inlined variables.
Reviewed By: jryans
Differential Revision: https://reviews.llvm.org/D133303
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUtils.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index c007a59..636392a 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -594,7 +594,7 @@ void llvm::deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE, } // Use a map to unique and a vector to guarantee deterministic ordering. - llvm::SmallDenseSet<std::pair<DIVariable *, DIExpression *>, 4> DeadDebugSet; + llvm::SmallDenseSet<DebugVariable, 4> DeadDebugSet; llvm::SmallVector<DbgVariableIntrinsic *, 4> DeadDebugInst; if (ExitBlock) { @@ -623,11 +623,8 @@ void llvm::deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE, auto *DVI = dyn_cast<DbgVariableIntrinsic>(&I); if (!DVI) continue; - auto Key = - DeadDebugSet.find({DVI->getVariable(), DVI->getExpression()}); - if (Key != DeadDebugSet.end()) + if (!DeadDebugSet.insert(DebugVariable(DVI)).second) continue; - DeadDebugSet.insert({DVI->getVariable(), DVI->getExpression()}); DeadDebugInst.push_back(DVI); } |