Is there a simple way to add a comment in the machine instructions of a basic block? Ideally something that can be used with machine instruction builder. Tia. Reed
On 04/16/2014 02:06 PM, reed kotler wrote:> Is there a simple way to add a comment in the machine instructions of a > basic block? > > Ideally something that can be used with machine instruction builder. > > Tia. > > ReedIn this case, I am working on the fast instruction selector for mips. I want to be able to tag instructions or regions of instructions that are emitted by the fast instruction selector as opposed to the normal mechanism. In fast instruction selector can always report that it cannot emit instructions for some construct and then that part falls on the normal mechanism; though in some cases the actual machine instructions emitted would be the same. So I want to be able to look for some kind of tag in the make check tests. Tia. Reed
Would adding a flag to MachineInstr::MIFlag do the trick? I'm thinking that fast isel could ensure that a flag (e.g. MIFlag::FastISel) is added to the instructions it creates, then the instruction printer could optionally emit a comment for instructions that have this flag.> -----Original Message----- > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On Behalf Of Reed Kotler > Sent: 16 April 2014 22:17 > To: LLVMdev at cs.uiuc.edu > Subject: Re: [LLVMdev] adding comment > > On 04/16/2014 02:06 PM, reed kotler wrote: > > Is there a simple way to add a comment in the machine instructions of > > a basic block? > > > > Ideally something that can be used with machine instruction builder. > > > > Tia. > > > > Reed > > In this case, I am working on the fast instruction selector for mips. > > I want to be able to tag instructions or regions of instructions that are > emitted by the fast instruction selector as opposed to the normal > mechanism. > > In fast instruction selector can always report that it cannot emit instructions > for some construct and then that part falls on the normal mechanism; though > in some cases the actual machine instructions emitted would be the same. > > So I want to be able to look for some kind of tag in the make check tests. > > Tia. > > Reed > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
On Apr 16, 2014, at 2:06 PM, reed kotler <rkotler at mips.com> wrote:> Is there a simple way to add a comment in the machine instructions of a basic block? > > Ideally something that can be used with machine instruction builder. >I’ve also been looking for something like this. I’m trying to start work on a pass that would be easiest to implement by merging multiple machine basic blocks into one, but I would really like to retain the comments marking the beginning of the merged blocks. I’ve been considering more complicated ways of doing it rather than losing those -Matt
On 04/17/2014 09:30 AM, Matt Arsenault wrote:> > On Apr 16, 2014, at 2:06 PM, reed kotler <rkotler at mips.com> wrote: > >> Is there a simple way to add a comment in the machine instructions of a basic block? >> >> Ideally something that can be used with machine instruction builder. >> > > I’ve also been looking for something like this. I’m trying to start work on a pass that would be easiest to implement by merging multiple machine basic blocks into one, but I would really like to retain the comments marking the beginning of the merged blocks. I’ve been considering more complicated ways of doing it rather than losing those > > -Matt >There is definitely a need for a mechanism to be able to add character data to any instruction which will get added as a comment. Reed