[PATCH] D125102: [RegAllocGreedy] New hook regClassPriorityTrumpsGlobalness

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 13 01:56:50 PDT 2022


foad added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/TargetRegisterInfo.h:57
   /// Classes with a higher priority value are assigned first by register
   /// allocators using a greedy heuristic. The value is in the range [0,63].
   const uint8_t AllocationPriority;
----------------
bjope wrote:
> This comment should clarify that if using GreedyRegClassPriorityTrumpsGlobalness then the range is [0,31].
> 
> When looking into how AllocationPriority is used (by our downstream target vs in-tree targets) I noticed that at least PowerPC is using AllocationPriority>32 to set bit 29 in Prio. So they use that as a way to get a higher prio compared to "global and split ranges" based on the AllocationPriority. So, is setting AllocationPriority > 32 a hackier way to trump globalness already without this patch?
Yes, setting AllocationPriority > 32 is definitely a //hackier// way of doing this! I don't like it, because then globalness is ignored even for two live ranges with the same AllocationPriority.

I don't want to document that the range is smaller only if you're using GreedyRegClassPriorityTrumpsGlobalness. Because in both cases, you can use priorities >= 32 if you really want to, and it will clobber some other bit in the Prio value.

Do you know //why// PowerPC uses priorities >= 32? Was it done deliberately to clobber the global bit?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125102



More information about the llvm-commits mailing list