nkavv at physics.auth.gr
2013-Jan-20 11:00 UTC
[LLVMdev] Inconsistent label syntax in LLVM assembly
Hi all, i'm writing a TXL (http://www.txl.ca) grammar and a revamp of bison/flex grammar for LLVM. I've noticed an inconsistency regarding label naming conventions. For instance, the following is a segment of legit LLVM assembly (human-readable) IR: 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)? Other branches appear using regular conventions: br i1 %exitcond, label %._crit_edge, label %.lr.ph ._crit_edge: ; preds = %.lr.ph, %.preheader So, naturally I have some questions: 1) What is the differences among the branch labels? Differences in the formation (e.g. emitted by different passes?) 2) How to normalize the appearance of branch labels? I.e. is it possible to not emit the strange ; <label>:39 like ones? 3) Why <label>:39 and not 39: ? 4) Why not prefixing all labels with <label>? Best regards Nikolaos Kavvadias
Hi Nikolaos, On 20/01/13 12:00, nkavv at physics.auth.gr wrote:> Hi all, > > i'm writing a TXL (http://www.txl.ca) grammar and a revamp of bison/flex grammar > for LLVM. > > I've noticed an inconsistency regarding label naming conventions. > > For instance, the following is a segment of legit LLVM assembly (human-readable) > IR: > > 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. Ciao, Duncan.> > Other branches appear using regular conventions: > > br i1 %exitcond, label %._crit_edge, label %.lr.ph > ._crit_edge: ; preds = %.lr.ph, %.preheader > > So, naturally I have some questions: > > 1) What is the differences among the branch labels? Differences in the formation > (e.g. emitted by different passes?) > > 2) How to normalize the appearance of branch labels? I.e. is it possible to not > emit the strange ; <label>:39 like ones? > > 3) Why <label>:39 and not 39: ? > > 4) Why not prefixing all labels with <label>? > > 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
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
Apparently Analagous 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)