[PATCH] D156491: [RA] Split a virtual register in cold blocks if it is not assigned preferred physical register

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 10:33:16 PDT 2023


Carrot added inline comments.


================
Comment at: llvm/lib/CodeGen/RegAllocGreedy.cpp:2404
+  if (!NewVRegs.empty())
+    return 0;
 
----------------
qcolombet wrote:
> qcolombet wrote:
> > Splitting decisions are supposed to be taken later (`trySplit`), this breaks the general algorithm's flow.
> Concretely, I'm asking if you could do this kind of splitting in the splitting heuristic.
> You may want to add a new stage in the algorithm (and that'll come at a compile time cost.)
The problem is we need to decide between a physical register and split, if we move it to trySplit, we will miss the possibility of assigning a physical register to the whole virtual register. trySplit compares splits against different physical registers, we need to compare split against non-split.
Function tryAssignCSRFirstTime does similar thing. trySplitAroundHintReg is even more special because it tries to split against only 1 physical register.



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

https://reviews.llvm.org/D156491



More information about the llvm-commits mailing list