[LLVMdev] Support for bundles of MCInst?

Mario Guerra mariog at codeaurora.org
Thu Nov 29 16:04:59 PST 2012

Hello Owen,

> There should already be sufficient support for what you're trying to do.
> MCOperand::CreateInst().  The concept is that you'll build a composite
MCInst in
> your AsmPrinter::EmitInstruction() method, which uses Inst-type MCOperands
> hold a list of sub-instructions.  Then you call
AsmStreamer::EmitInstruction() on the
> composite MCInst.

Thanks for your reply. This is actually one approach we are considering, but
there are a few issues with it we weren't sure how to address. 

One is that the lifespan of an MCInst seems to be limited to the scope of
AsmPrinter, and we need them to be persistent in order to do a traversal for
branch relaxation and fetch boundary alignment optimizations. Furthermore,
even if they were persistent there doesn't seem to be a way to traverse
MCInst objects due to a lack of iterator support. Have we overlooked this
functionality? If not, does it make sense for us to add it?

Those issues aside, it sounds like the streamer already understands how to
process and print sub-instructions, which is good. Will the size of the
packet be properly accounted for by the MCObjectStreamer if we have to pad
the packet (mainly for fetch alignment)?

- --
Mario Guerra
mariog at codeaurora.org
Qualcomm Innovation Center Inc is a member of Code Aurora Forum, hosted by
The Linux Foundation

More information about the llvm-dev mailing list