Skip to content

Commit bc09beb

Browse files
[AMDGPU] Avoid repeated hash lookups (NFC) (#112309)
1 parent 57d109c commit bc09beb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Target/AMDGPU/SIOptimizeVGPRLiveRange.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ void SIOptimizeVGPRLiveRange::collectElseRegionBlocks(
189189
unsigned Cur = 0;
190190
while (MBB) {
191191
for (auto *Pred : MBB->predecessors()) {
192-
if (Pred != Flow && !Blocks.contains(Pred))
192+
if (Pred != Flow)
193193
Blocks.insert(Pred);
194194
}
195195

@@ -407,10 +407,8 @@ void SIOptimizeVGPRLiveRange::updateLiveRangeInThenRegion(
407407
while (!WorkList.empty()) {
408408
auto *MBB = WorkList.pop_back_val();
409409
for (auto *Succ : MBB->successors()) {
410-
if (Succ != Flow && !Blocks.contains(Succ)) {
410+
if (Succ != Flow && Blocks.insert(Succ))
411411
WorkList.push_back(Succ);
412-
Blocks.insert(Succ);
413-
}
414412
}
415413
}
416414

0 commit comments

Comments
 (0)