[PATCH] D15302: [Greedy regalloc] Replace analyzeSiblingValues with something new [Part1]

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 14:44:13 PDT 2016


tstellarAMD added a comment.

In http://reviews.llvm.org/D15302#379497, @wmi wrote:

> I noticed that even without my change, although compiler output "GCN:
>  NumVgprs is 256", when I looked at the trace of -debug-only=regalloc,
>  I found there were some VGPR unused.
>
> Here is what I did:
>  ~/workarea/llvm-r262808/dbuild/./bin/llc -march=amdgcn -mcpu=tahiti
>  -mattr=+vgpr-spilling -verify-machineinstrs <
>  ~/workarea/llvm-r262808/src/test/CodeGen/AMDGPU/vgpr-spill-emergency-stack-slot.ll
>  -debug-only=regalloc >/dev/null 2>out1
>
> Delete the trace from out1 before the section of "REGISTER MAP", then
>  execute the command below:
>  for ((i=0; i<256; i++)); do
>
>   grep "VGPR$i[^0-9]" out1 &>/dev/null
>   if [[ "$?" != "0" ]]; then
>     echo VGPR$i
>   fi
>
> done
>
> The output is:
> VGPR40
> VGPR189
> VGPR190
>
> So even if the compiler says GCN: NumVgprs is 256, there are three
>  VGPRs never used.


NumVgprs is the number of VGPRs that need to be allocated for the program, so the fact that there are gaps doesn't matter (though this is strange).  If you use only register v255, you still need to allocate all 256 registers.


Repository:
  rL LLVM

http://reviews.llvm.org/D15302





More information about the llvm-commits mailing list