On Feb 11, 2010, at 12:50 PM, David Greene wrote:> On Thursday 11 February 2010 14:05:21 David Greene wrote: > >> Either ParseLoad and probably other instructions need to look for metadata >> explicitly or ParseOptionalCommaAlign needs to know about general metadata. >> >> My inkling is to fix ParseOptionalCommaAlign. Sound reasonable? > > Well, that's a rat's nest. I backed up and thought maybe I have the metadata > syntax wrong. > > So I tried a bunch of things: > > %r8 = load <2 x double>* %r6, align 16, metadata !"nontemporal" > %r8 = load <2 x double>* %r6, align 16, metadata !nontemporal > %r8 = load <2 x double>* %r6, align 16, !{ metadata !"nontemporal" } > %r8 = load <2 x double>* %r6, align 16, !{ metadata !nontemporal } > %r8 = load <2 x double>* %r6, align 16, !{ !"nontemporal" } > %r8 = load <2 x double>* %r6, align 16, !{ !nontemporal } > > I give up! What is the syntax for attaching metadata to instructions? The > documentation is very unclear.Some examples are in llvm/test/Feature/md_on_instruction.ll Or you could just compile a file with -g. -Chris
On Thu, Feb 11, 2010 at 12:56 PM, Chris Lattner <clattner at apple.com> wrote:> > On Feb 11, 2010, at 12:50 PM, David Greene wrote: > >> On Thursday 11 February 2010 14:05:21 David Greene wrote: >> >>> Either ParseLoad and probably other instructions need to look for metadata >>> explicitly or ParseOptionalCommaAlign needs to know about general metadata. >>> >>> My inkling is to fix ParseOptionalCommaAlign. Sound reasonable? >> >> Well, that's a rat's nest. I backed up and thought maybe I have the metadata >> syntax wrong. >> >> So I tried a bunch of things: >> >> %r8 = load <2 x double>* %r6, align 16, metadata !"nontemporal" >> %r8 = load <2 x double>* %r6, align 16, metadata !nontemporal >> %r8 = load <2 x double>* %r6, align 16, !{ metadata !"nontemporal" } >> %r8 = load <2 x double>* %r6, align 16, !{ metadata !nontemporal } >> %r8 = load <2 x double>* %r6, align 16, !{ !"nontemporal" } >> %r8 = load <2 x double>* %r6, align 16, !{ !nontemporal } >> >> I give up! What is the syntax for attaching metadata to instructions? The >> documentation is very unclear. > > Some examples are in llvm/test/Feature/md_on_instruction.ll > > Or you could just compile a file with -g.And then fix the documentation! :)
On Thursday 11 February 2010 14:56:16 Chris Lattner wrote:> > I give up! What is the syntax for attaching metadata to instructions? > > The documentation is very unclear. > > Some examples are in llvm/test/Feature/md_on_instruction.ll > > Or you could just compile a file with -g.But neither of these explains what the grammar is. It looks like gibberish to me... -Dave
I don't think the lang ref metadata grammar section (http://llvm.org/docs/LangRef.html#metadata) has been fully updated with how !dbg metadata is used in http://llvm.org/docs/SourceLevelDebugging.html. At least to me it is not clear. In my mind I translate the phrase "LLVM IR allows metadata to be attached to instructions " into a grammar depicted in SourceLevelDebugging.html. I was going to ask about this, but I'll let you instead. :-) Garrison On Feb 11, 2010, at 16:42, David Greene wrote:> On Thursday 11 February 2010 14:56:16 Chris Lattner wrote: > >>> I give up! What is the syntax for attaching metadata to instructions? >>> The documentation is very unclear. >> >> Some examples are in llvm/test/Feature/md_on_instruction.ll >> >> Or you could just compile a file with -g. > > But neither of these explains what the grammar is. It looks like gibberish to > me... > > -Dave > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>> I give up! What is the syntax for attaching metadata to instructions? The >>> documentation is very unclear. >> >> Some examples are in llvm/test/Feature/md_on_instruction.ll >> >> Or you could just compile a file with -g. > > And then fix the documentation!That's on my TODO list for 2.7, unless someone beats me writing this doc :) - Devang