Skip to content

Commit d3a9cde

Browse files
authored
[AMDGPU] Don't skip regions in getRegionLiveInMap (#151423)
Currently, this skips any region that is not the first region in a block. This is because the only user of it only cares about the LiveIns per-block. However, as named, this is supposed to compute the per-region LiveIns. This doesn't have any effect on scheduling / CodeGen currently (aside from computing LiveIns for all regions) since only the per-block LiveIns are needed. However, I'm working on something that will use this. Intended User: #149367 https://github.com/llvm/llvm-project/blob/c62a2f127cba5d6df350474dfd4a6e5f9250fe4f/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp#L1351
1 parent ba2edbd commit d3a9cde

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -896,15 +896,10 @@ GCNScheduleDAGMILive::getRegionLiveInMap() const {
896896
assert(!Regions.empty());
897897
std::vector<MachineInstr *> RegionFirstMIs;
898898
RegionFirstMIs.reserve(Regions.size());
899-
auto I = Regions.rbegin(), E = Regions.rend();
900-
do {
901-
const MachineBasicBlock *MBB = I->first->getParent();
902-
auto *MI = &*skipDebugInstructionsForward(I->first, I->second);
903-
RegionFirstMIs.push_back(MI);
904-
do {
905-
++I;
906-
} while (I != E && I->first->getParent() == MBB);
907-
} while (I != E);
899+
for (auto &[RegionBegin, RegionEnd] : reverse(Regions))
900+
RegionFirstMIs.push_back(
901+
&*skipDebugInstructionsForward(RegionBegin, RegionEnd));
902+
908903
return getLiveRegMap(RegionFirstMIs, /*After=*/false, *LIS);
909904
}
910905

0 commit comments

Comments
 (0)