Skip to content

Commit 9ed220f

Browse files
committed
refactor
1 parent 5268ef5 commit 9ed220f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,10 @@ class AMDGPUInsertDelayAlu : public MachineFunctionPass {
366366
DelayType Type = getDelayType(MI.getDesc().TSFlags);
367367

368368
if (SII->isSALU(MI.getOpcode())) {
369-
if (State.find(lastSGPRfromVALU) != State.end()){
370-
State.advanceByNum(SALU, State[lastSGPRfromVALU].VALUCycles, State[lastSGPRfromVALU].VALUNum);
369+
auto It = State.find(lastSGPRfromVALU);
370+
if (It != State.end()) {
371+
DelayInfo Info = It->getSecond();
372+
State.advanceByNum(VALU, Info.VALUCycles, Info.VALUNum);
371373
lastSGPRfromVALU = 0;
372374
}
373375
}

0 commit comments

Comments
 (0)