[PATCH] D126771: [fastalloc] Support allocate specific register class in fastalloc.

Xiang Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 19 23:43:41 PDT 2022


xiangzhangllvm added inline comments.


================
Comment at: llvm/lib/CodeGen/RegAllocFast.cpp:1162
         }
       } else if (Reg.isPhysical()) {
         if (!MRI->isReserved(Reg)) {
----------------
PLS recheck the ShouldAllocateRegister for physic regs.
(We should not handle (reload/spill for) the un-expected physic regs in the pass.)


================
Comment at: llvm/lib/CodeGen/RegAllocFast.cpp:1402
         continue;
+      if (Reg.isVirtual() && !ShouldAllocateRegister(Reg))
+        continue;
----------------
LuoYuanke wrote:
> xiangzhangllvm wrote:
> > I think here should remove the check of "!ShouldAllocateRegister"
> It seems keeping `!ShouldAllocateRegister(Reg)` can catch the unexpected bug by line 1404 where tile register has been allocated to tile physical register but it is still virtual register. I can add an additional assert here.
That is well too.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126771



More information about the llvm-commits mailing list