[llvm] [AMDGPU][MachineScheduler] Alternative way to control excess RP. (PR #68004)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 3 03:37:16 PDT 2023
================
@@ -894,10 +894,24 @@ void GCNSchedStage::setupNewBlock() {
void GCNSchedStage::finalizeGCNRegion() {
DAG.Regions[RegionIdx] = std::pair(DAG.RegionBegin, DAG.RegionEnd);
- DAG.RescheduleRegions[RegionIdx] = false;
- if (S.HasHighPressure)
+ PressureAfter = DAG.getRealRegPressure(RegionIdx);
+
+ unsigned NewVGPRRP = PressureAfter.getVGPRNum(false);
+ unsigned NewAGPRRP = PressureAfter.getAGPRNum();
+ unsigned NewSGPRRP = PressureAfter.getSGPRNum();
+
+ if ((NewVGPRRP >= S.VGPRCriticalLimit - S.VGPRExcessMargin) ||
+ (NewAGPRRP >= S.VGPRCriticalLimit - S.VGPRExcessMargin) ||
+ (NewSGPRRP >= S.SGPRCriticalLimit - S.SGPRExcessMargin))
DAG.RegionsWithHighRP[RegionIdx] = true;
+ if ((NewVGPRRP >= S.VGPRExcessLimit - S.VGPRExcessMargin) ||
+ (NewAGPRRP >= S.VGPRExcessLimit - S.SGPRExcessMargin) ||
----------------
alex-t wrote:
Sure, it is just a typo. The whole code is an early draft. I used the pull request as a place for discussing the idea.
https://github.com/llvm/llvm-project/pull/68004
More information about the llvm-commits
mailing list