[PATCH] D119475: [AMDGPU] Add scheduler pass to rematerialize trivial defs

Vang Thao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 24 20:51:02 PST 2022


vangthao marked 12 inline comments as done.
vangthao added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp:776
+  int BestRegDiff = VGPRUsage - RematerializableInsts.size();
+  BestRegDiff = std::max(BestRegDiff, 0);
+  unsigned BestScenarioOccupancy = ST.getOccupancyWithNumVGPRs(BestRegDiff);
----------------
vpykhtin wrote:
> Is there any way that VGPRUsage is less than RematerializableInsts.size()?
It should not be possible if we filter instructions relevant only to this block.


================
Comment at: llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp:909
+        if (Removing)
+          Regions[I] = std::make_pair(std::next(MI), Regions[I].second);
+        else
----------------
vpykhtin wrote:
> Should this skip debug instructions? (and other places in this function too)
We shouldn't skip debug instructions here because they can be selected as a RegionBegin of a region.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119475/new/

https://reviews.llvm.org/D119475



More information about the llvm-commits mailing list