[PATCH] D99284: [RegAllocFast] properly handle STATEPOINT instruction.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 31 15:08:57 PDT 2021


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/RegAllocFast.cpp:1220
+          if (MO.isTied()) {
+            LiveRegMap::iterator LRI = findLiveVirtReg(Reg);
+            assert(LRI != LiveVirtRegs.end() && "LR must be processed");
----------------
I don't like relying on findLiveVirtReg getting called a second time returning the same result as during the actual assignment


================
Comment at: llvm/lib/CodeGen/RegAllocFast.cpp:1254
 
       // Do not free tied operands and early clobbers.
       if (MO.isTied() || MO.isEarlyClobber())
----------------
Can you track the register from here instead?


================
Comment at: llvm/lib/CodeGen/RegAllocFast.cpp:1278
         for (const LiveReg &LR : LiveVirtRegs) {
           MCPhysReg PhysReg = LR.PhysReg;
+          if (AssignedTiedDefs.count(PhysReg))
----------------
Should get a comment explaining the tied behavior


================
Comment at: llvm/lib/CodeGen/RegAllocFast.cpp:1279
           MCPhysReg PhysReg = LR.PhysReg;
+          if (AssignedTiedDefs.count(PhysReg))
+            continue;
----------------
Checking for exact register matches makes me nervous because of register aliases / subregisters. What if you had something like

FOO tied-def $reg0_reg1, tied-use $reg0_reg1, mask-clobber(reg1)?

What is the correct behavior here and does it matter? Should it be a verifier error?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99284



More information about the llvm-commits mailing list