[LLVMdev] Inconsistent label syntax in LLVM assembly

Duncan Sands baldrick at free.fr
Sun Jan 20 04:47:34 PST 2013

Hi Nikolaos,

On 20/01/13 13:19, 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.

labels don't determine where a basic block starts or stops, terminator
instructions do.  It is possible to give a basic block a name, in which
case when writing out a .ll file that name will be output as a "label",
but the "label" has no functional utility, it's not a label like in real
assembler.  If a basic block has no name then it is referred to in the .ll
by the number of the basic block, eg %39.

Ciao, Duncan.

More information about the llvm-dev mailing list