[greedyalloc] Return early when there is no register to allocate.
authorLuo, Yuanke <yuanke.luo@intel.com>
Wed, 29 Jun 2022 11:13:16 +0000 (19:13 +0800)
committerLuo, Yuanke <yuanke.luo@intel.com>
Thu, 30 Jun 2022 03:12:05 +0000 (11:12 +0800)
commitfa8656d28d795a45dd76f5ca6030c5eef4c7003a
treed9833414c8db5742d98d2221a8e6c4a6e7d3caa1
parent1b8cde9b633841c7199b345132423dd3d6bdf3e7
[greedyalloc] Return early when there is no register to allocate.

In X86 we split greddy register allocation into 2 passes. The 1st pass
is to allocate tile register, and the 2nd pass is to allocate the rest
of virtual register. In most cases there is no tile register, so the 1st
pass is unnecessary. To improve the compiling time, we check if there is
any register need to be allocated by invoking callback
`ShouldAllocateClass`. If there is no register to be allocated, just
return false in the pass. This would improve the 1st greed RA pass for
normal cases.

Differential Revision: https://reviews.llvm.org/D128804
llvm/lib/CodeGen/RegAllocGreedy.cpp
llvm/lib/CodeGen/RegAllocGreedy.h