Skip to content

Commit

Permalink
[AMDGPU] Avoid repeated hash lookups (NFC) (llvm#112309)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored and EricWF committed Oct 22, 2024
1 parent d291c06 commit 4b04204
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions llvm/lib/Target/AMDGPU/SIOptimizeVGPRLiveRange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void SIOptimizeVGPRLiveRange::collectElseRegionBlocks(
unsigned Cur = 0;
while (MBB) {
for (auto *Pred : MBB->predecessors()) {
if (Pred != Flow && !Blocks.contains(Pred))
if (Pred != Flow)
Blocks.insert(Pred);
}

Expand Down Expand Up @@ -407,10 +407,8 @@ void SIOptimizeVGPRLiveRange::updateLiveRangeInThenRegion(
while (!WorkList.empty()) {
auto *MBB = WorkList.pop_back_val();
for (auto *Succ : MBB->successors()) {
if (Succ != Flow && !Blocks.contains(Succ)) {
if (Succ != Flow && Blocks.insert(Succ))
WorkList.push_back(Succ);
Blocks.insert(Succ);
}
}
}

Expand Down

0 comments on commit 4b04204

Please sign in to comment.