Skip to content

Commit de06978

Browse files
[AMDGPU] Avoid repeated hash lookups (NFC) (#127445)
1 parent 36f8c8b commit de06978

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/AMDGPU/R600OptimizeVectorRegisters.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,10 @@ bool R600VectorRegMerger::tryMergeUsingCommonSlot(RegSeqInfo &RSI,
270270
MOE = RSI.Instr->operands_end(); MOp != MOE; ++MOp) {
271271
if (!MOp->isReg())
272272
continue;
273-
if (PreviousRegSeqByReg[MOp->getReg()].empty())
273+
auto &Insts = PreviousRegSeqByReg[MOp->getReg()];
274+
if (Insts.empty())
274275
continue;
275-
for (MachineInstr *MI : PreviousRegSeqByReg[MOp->getReg()]) {
276+
for (MachineInstr *MI : Insts) {
276277
CompatibleRSI = PreviousRegSeq[MI];
277278
if (RSI == CompatibleRSI)
278279
continue;

0 commit comments

Comments
 (0)