[LLVMdev] Inconsistent label syntax in LLVM assembly
baldrick at free.fr
Sun Jan 20 04:55:47 PST 2013
On 20/01/13 13:46, nkavv at physics.auth.gr wrote:
> Hi Duncan
>>>> br i1 %38, label %17, label %39
>>>> ; <label>:39 ; preds = %._crit_edge
>>>> ret void
>>>> However, ";" is a comment-line character. How is this interpreted, as a
>>>> meta-comment? (a semantically important comment)?
>>> it's just a comment and has no semantic comment. You can delete it, it won't
>>> make any difference.
>> OK. However, in this case, how is the branch resolved? I mean that there is no
>> obvious %39 label declared in the LLVM translation unit.
> I can see that there is a certain convention; e.g. %39 is the assumed (implicit)
> label, if the %38 is the last defined temporary at that point of the function body.
> So, I guess that if the following basic block has no explicit label, it acquires
> one by generating a new temporary. This is my deduction; I'm not sure it is
> correct though.
that's it. It's the same for nameless instructions for example. Note that
these numbers only exist in the human readable IR. There has to be some way
when parsing human readable IR to know which basic block is being referred to.
That's what the numbers are for.
> Best regards
> Nikolaos Kavvadias
>> Best regards
>> Nikolaos Kavvadias
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev