Skip to content

Commit 3ce97e4

Browse files
[ReachingDefAnalysis][NFC] Use at instead of lookup for DenseMap access
`at` has an assert that the key exists. Since we are assuming the key exists, use `at` instead of `lookup`.
1 parent 6900768 commit 3ce97e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/ReachingDefAnalysis.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ int ReachingDefAnalysis::getReachingDef(MachineInstr *MI, Register Reg) const {
348348

349349
if (Register::isStackSlot(Reg)) {
350350
int FrameIndex = Register::stackSlot2Index(Reg);
351-
for (int Def : MBBFrameObjsReachingDefs.lookup(MBBNumber).lookup(
352-
FrameIndex - ObjectIndexBegin)) {
351+
int Key = FrameIndex - ObjectIndexBegin;
352+
for (int Def : MBBFrameObjsReachingDefs.at(MBBNumber).at(Key)) {
353353
if (Def >= InstId)
354354
break;
355355
DefRes = Def;

0 commit comments

Comments
 (0)