[llvm] [AMDGPU][NPM] Port AMDGPUMarkLastScratchLoad to NPM (PR #131738)
    Matt Arsenault via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Mar 17 23:41:00 PDT 2025
    
    
  
================
@@ -56,17 +64,34 @@ class AMDGPUMarkLastScratchLoad : public MachineFunctionPass {
 
 } // end anonymous namespace
 
-bool AMDGPUMarkLastScratchLoad::runOnMachineFunction(MachineFunction &MF) {
+bool AMDGPUMarkLastScratchLoadLegacy::runOnMachineFunction(
+    MachineFunction &MF) {
   if (skipFunction(MF.getFunction()))
     return false;
 
+  auto *LS = &getAnalysis<LiveStacksWrapperLegacy>().getLS();
+  auto *LIS = &getAnalysis<LiveIntervalsWrapperPass>().getLIS();
+  auto *SI = &getAnalysis<SlotIndexesWrapperPass>().getSI();
+
+  return AMDGPUMarkLastScratchLoad(LS, LIS, SI).run(MF);
----------------
arsenm wrote:
```suggestion
  auto &LS = getAnalysis<LiveStacksWrapperLegacy>().getLS();
  auto &LIS = getAnalysis<LiveIntervalsWrapperPass>().getLIS();
  auto &SI = getAnalysis<SlotIndexesWrapperPass>().getSI();
  return AMDGPUMarkLastScratchLoad(&LS, &LIS, &SI).run(MF);
```
https://github.com/llvm/llvm-project/pull/131738
    
    
More information about the llvm-commits
mailing list