nkavv at physics.auth.gr
2013-Jan-20 12:19 UTC
[LLVMdev] Inconsistent label syntax in LLVM assembly
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. Best regards Nikolaos Kavvadias
nkavv at physics.auth.gr
2013-Jan-20 12:46 UTC
[LLVMdev] Inconsistent label syntax in LLVM assembly
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. Best regards Nikolaos Kavvadias> > > Best regards > Nikolaos Kavvadias > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >
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.
Hi Nikolaos, 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. Ciao, Duncan.> > > Best regards > Nikolaos Kavvadias > > >> >> >> Best regards >> Nikolaos Kavvadias >> >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> > > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reasonably Related Threads
- [LLVMdev] Inconsistent label syntax in LLVM assembly
- [LLVMdev] Inconsistent label syntax in LLVM assembly
- [LLVMdev] Inconsistent label syntax in LLVM assembly
- [LLVMdev] Problem with PTX assembly printing (NVPTX backend)
- [LLVMdev] Problem with PTX assembly printing (NVPTX backend)