[LLVMdev] RegisterCoalescing Pass seems to ignore part of CFG.

Ivan Llopard ivanllopard at gmail.com
Thu Oct 25 12:54:03 PDT 2012


Hi Vincent,

On 25/10/2012 18:14, Vincent Lejeune wrote:
> When examining the debug output of regalloc, it seems that joining 32bits reg also joins 128 parent reg.
>
> If I look at the :
> %vreg34<def> = COPY %vreg6:sel_y; R600_Reg32:%vreg34 R600_Reg128:%vreg6
>
> instructions ; it gets joined to :
> 928B%vreg34<def> = COPY %vreg48:sel_y;
>
> when vreg6 and vreg48 are joined. It's right.
>
> But joining the following copy
>
> 912B%vreg32:sel_x<def,read-undef> = COPY %vreg48:sel_x; R600_Reg128:%vreg32,%vreg48
>
> updates it to
> 928B%vreg34<def> = COPY %vreg32:sel_y; R600_Reg32:%vreg34 R600_Reg128:%vreg32
>
> which is wrong. vreg32:sel_y is undef.

Well, that seems correct to me. Following the code and debug output, the 
joining is going from vreg6->vreg48->vreg32. vreg6 is defined at BB0, so 
it will be vreg32 and its sel_y subreg also.
Try to run the verifier with -verify-coalescing.
If you have implemented the hooks for the coalescer in your 
TargetRegisterInfo you can also try to disable them to verify the 
implementation. Hope this helps to spot the problem.

Ivan

>
> Regards,
> Vincent
>



More information about the llvm-dev mailing list