[PATCH] D134951: [CodeGen][RegAllocFast] Add MRI delegate callback to notify VReg spill

Christudasan Devadasan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 27 10:24:57 PDT 2022


cdevadas added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/MachineRegisterInfo.h:189
+  void noteVirtualRegisterSpill(Register Reg) {
+    for (const auto &TheDelegate : TheDelegates)
+      TheDelegate->MRI_NoteVirtualRegisterSpill(Reg);
----------------
arsenm wrote:
> I assume TheDelegates are pointers, so const X *TheDelegate?
Yes, they are pointers, will use *


================
Comment at: llvm/lib/CodeGen/LiveRangeEdit.cpp:36
                                                      bool createSubRanges) {
-  Register VReg = MRI.createVirtualRegister(MRI.getRegClass(OldReg));
+  Register VReg = MRI.cloneVirtualRegister(OldReg);
   if (VRM)
----------------
arsenm wrote:
> Is the clone still strictly necessary for this patch?
Not necessarily in the same patch. They are basically needed to notify the targets when the RegAllocFast clone registers (for AMDGPU they are needed to propagate the vreg flags). They are included in the earlier patch where the VRegFlags are added directly in the MachineRegisterInfo file.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134951



More information about the llvm-commits mailing list