[LLVMdev] Machine code sinking pass

Quentin Colombet qcolombet at apple.com
Tue Sep 2 09:36:43 PDT 2014


Hi Jonas,

This looks like a bug in Machine code sinking pass.

Please file a PR on llvm.org/bugs with a reduced test case to keep track of the issue.

Thanks,
-Quentin

On Sep 2, 2014, at 5:57 AM, Jonas Paulsson <jonas.paulsson at ericsson.com> wrote:

> Hi,
>  
> I ran into MachineVerifier ”Virtual register killed in block, but needed live out.”
>  
> It was MachineSinking:PerformTrivialForwardCoalescing() that coalesced a COPY inside a single-block loop, but left the
> kill-flag and then MachineVerifier complains that a register in vregsRequired is killed in MBB.
>  
> In the example, %vreg520 is replaced by %vreg368 by PerformTrivialForwardCoalescing(), without clearing the kill flag:
>  
> BB#13: derived from LLVM BB %CF250
>     Predecessors according to CFG: BB#12 BB#13 BB#14
>>         %vreg520<def> = COPY %vreg368
>         %vreg568<def,tied1> = cmp %vreg341<tied0>, %vreg520<kill>
>         brr_cond <BB#13>
>         brr_uncond <BB#14>
>     Successors according to CFG: BB#13, BB#14
>  
> Into
>  
> BB#13: derived from LLVM BB %CF250
>     Predecessors according to CFG: BB#12 BB#13 BB#14
>>         %vreg568<def,tied1> = cmp %vreg341<tied0>, %vreg368<kill>
>         brr_cond <BB#13>
>         brr_uncond <BB#14>
>  
> =>
>  
> *** Bad machine code: Virtual register killed in block, but needed live out. ***
> - function:    autogen_SD15028
> - basic block: BB#13 CF250 (0x1c75890)
> Virtual register %vreg368 is used after the block.
>  
> There is only one use of %vreg368 in the function.
>  
> One thing that strikes me is that one might want to clear the kill flag for a use inside a loop of a register defined prior to
> the loop?
>  
> Best regards,
>  
> Jonas Paulsson
>  
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140902/19625725/attachment.html>


More information about the llvm-dev mailing list