[PATCH] D109052: [AMDGPU][GlobalISel] Fix waterfall loops

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 6 08:05:09 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/Localizer.cpp:172
 
-    MachineBasicBlock::iterator II(MI);
+    MachineBasicBlock::instr_iterator II(MI);
     ++II;
----------------
sebastian-ne wrote:
> foad wrote:
> > Why is this change needed? Normally a BUNDLE instruction has use operands representing all the uses of the instructions inside the bundle, so I think this code should just work without any changes? See comment in lowerCall...
> As far as I understand, it only has that after register allocation (or somewhere in these passes, like phi elimination. The pass that adds the BUNDLE instruction also adds the uses and defs).
AMDGPU creates some bundles at instruction selection time, and it does use finalizeBundle, but they do not have any defs, so maybe that does not violate SSA? Example:
```
  BUNDLE implicit killed %6:vgpr_32, implicit $m0, implicit $exec {
    DS_GWS_BARRIER killed %6:vgpr_32, 0, implicit $m0, implicit $exec :: (load (s32) from custom "GWSResource")
    S_WAITCNT 0
  }
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109052



More information about the llvm-commits mailing list