Jeroen Dobbelaere
2013-May-30 21:16 UTC
[LLVMdev] How to associate extra comments to a MachineInstruction ?
> From: Eric Christopher > Subject: Re: [LLVMdev] How to associate extra comments to a > MachineInstruction ? > > Should be spelled like this yes? > > Asm->OutStreamer.AddComment("foo") > Asm->EmitFoo(); > > -ericThat should work at the moment that you are emitting the instructions. But what would you do when you are manipulating a MachineBasicBlock and want to annotate some instructions there ? (way before the assembler jumps in) The annotation belongs to the instruction and other manipulations that are performed later (like reordering of instructions) should keep the annotation (iff the instruction itself is kept). Greetings, Jeroen> > On Thu, May 30, 2013 at 1:44 PM, Jeroen Dobbelaere > <Jeroen.Dobbelaere at synopsys.com> wrote: > > Hi, > > > > is there a convenient way to associate/add a comment to a > MachineInstruction, so that > > in the produced assembly file, the comment is added next to the > instruction ? > > > > Greetings, > > > > Jeroen Dobbelaere > > > > > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Eric Christopher
2013-May-30 21:53 UTC
[LLVMdev] How to associate extra comments to a MachineInstruction ?
On Thu, May 30, 2013 at 2:16 PM, Jeroen Dobbelaere <Jeroen.Dobbelaere at synopsys.com> wrote:>> From: Eric Christopher >> Subject: Re: [LLVMdev] How to associate extra comments to a >> MachineInstruction ? >> >> Should be spelled like this yes? >> >> Asm->OutStreamer.AddComment("foo") >> Asm->EmitFoo(); >> >> -eric > > > That should work at the moment that you are emitting the instructions. >Yep.> But what would you do when you are manipulating a MachineBasicBlock and want to > annotate some instructions there ? (way before the assembler jumps in) > The annotation belongs to the instruction and other manipulations that are performed later (like reordering of instructions) > should keep the annotation (iff the instruction itself is kept). >Not really a way to do it so far. There's a set of specific comments to put on, but... -eric> Greetings, > > Jeroen > >> >> On Thu, May 30, 2013 at 1:44 PM, Jeroen Dobbelaere >> <Jeroen.Dobbelaere at synopsys.com> wrote: >> > Hi, >> > >> > is there a convenient way to associate/add a comment to a >> MachineInstruction, so that >> > in the produced assembly file, the comment is added next to the >> instruction ? >> > >> > Greetings, >> > >> > Jeroen Dobbelaere >> > >> > >> > _______________________________________________ >> > LLVM Developers mailing list >> > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Andrew Trick
2013-Jun-01 02:29 UTC
[LLVMdev] How to associate extra comments to a MachineInstruction ?
On May 30, 2013, at 2:53 PM, Eric Christopher <echristo at gmail.com> wrote:> On Thu, May 30, 2013 at 2:16 PM, Jeroen Dobbelaere > <Jeroen.Dobbelaere at synopsys.com> wrote: >>> From: Eric Christopher >>> Subject: Re: [LLVMdev] How to associate extra comments to a >>> MachineInstruction ? >>> >>> Should be spelled like this yes? >>> >>> Asm->OutStreamer.AddComment("foo") >>> Asm->EmitFoo(); >>> >>> -eric >> >> >> That should work at the moment that you are emitting the instructions. >> > > Yep. > >> But what would you do when you are manipulating a MachineBasicBlock and want to >> annotate some instructions there ? (way before the assembler jumps in) >> The annotation belongs to the instruction and other manipulations that are performed later (like reordering of instructions) >> should keep the annotation (iff the instruction itself is kept). >> > > Not really a way to do it so far. There's a set of specific comments > to put on, but...It would be nice, but there’s no existing mechanism. I personally think it should be handled by adding an implicit operand to the machineinstr that holds a constant index into a table of annotations strings, or maybe an MDNode is more convenient. Unfortunately there’s target-specific code lurking out there that makes assumptions about the number of operands. -Andy>>> >>> On Thu, May 30, 2013 at 1:44 PM, Jeroen Dobbelaere >>> <Jeroen.Dobbelaere at synopsys.com> wrote: >>>> Hi, >>>> >>>> is there a convenient way to associate/add a comment to a >>> MachineInstruction, so that >>>> in the produced assembly file, the comment is added next to the >>> instruction ? >>>> >>>> Greetings, >>>> >>>> Jeroen Dobbelaere >>>> >>>> >>>> _______________________________________________ >>>> 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-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130531/757ad68d/attachment.html>
Apparently Analagous Threads
- [LLVMdev] How to associate extra comments to a MachineInstruction ?
- [LLVMdev] How to associate extra comments to a MachineInstruction ?
- [LLVMdev] How to associate extra comments to a MachineInstruction ?
- Inlining + CSE + restrict pointers == funtimes
- LLVM Alias Analysis Technical Call - Doodle Poll