[llvm] r348999 - [LoopUtils] Prefer a set over a map. NFCI.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 12 17:11:52 PST 2018
Author: davide
Date: Wed Dec 12 17:11:52 2018
New Revision: 348999
URL: http://llvm.org/viewvc/llvm-project?rev=348999&view=rev
Log:
[LoopUtils] Prefer a set over a map. NFCI.
Modified:
llvm/trunk/lib/Transforms/Utils/LoopUtils.cpp
Modified: llvm/trunk/lib/Transforms/Utils/LoopUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUtils.cpp?rev=348999&r1=348998&r2=348999&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopUtils.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopUtils.cpp Wed Dec 12 17:11:52 2018
@@ -570,9 +570,7 @@ void llvm::deleteDeadLoop(Loop *L, Domin
}
// Use a map to unique and a vector to guarantee deterministic ordering.
- llvm::SmallDenseMap<std::pair<DIVariable *, DIExpression *>,
- DbgVariableIntrinsic *, 4>
- DeadDebugMap;
+ llvm::SmallDenseSet<std::pair<DIVariable *, DIExpression *>, 4> DeadDebugSet;
llvm::SmallVector<DbgVariableIntrinsic *, 4> DeadDebugInst;
// Given LCSSA form is satisfied, we should not have users of instructions
@@ -602,10 +600,10 @@ void llvm::deleteDeadLoop(Loop *L, Domin
auto *DVI = dyn_cast<DbgVariableIntrinsic>(&I);
if (!DVI)
continue;
- auto Key = DeadDebugMap.find({DVI->getVariable(), DVI->getExpression()});
- if (Key != DeadDebugMap.end())
+ auto Key = DeadDebugSet.find({DVI->getVariable(), DVI->getExpression()});
+ if (Key != DeadDebugSet.end())
continue;
- DeadDebugMap[{DVI->getVariable(), DVI->getExpression()}] = DVI;
+ DeadDebugSet.insert({DVI->getVariable(), DVI->getExpression()});
DeadDebugInst.push_back(DVI);
}
More information about the llvm-commits
mailing list