[LLVMdev] Support for bundles of MCInst?

Owen Anderson resistor at mac.com
Thu Nov 29 15:13:45 PST 2012


Mario,

On Nov 29, 2012, at 3:00 PM, Mario Guerra <mariog at codeaurora.org> wrote:

> We're developing an integrated assembler for a VLIW target, and some of the
> optimizing our assembler needs to do must be done on a per-packet basis.
> This requires us to be able to traverse instruction within a packet, and one
> particular optimization requires traversal of previous packets as well. 
> 
> We're considering adding support for MCInst bundles in the MC layer to
> accommodate this use case, analogous to what currently exists for
> MachineInstr. Has anyone given thought to this before? Is there already a
> way to create bundles in the MC layer that we've overlooked? 

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

--Owen



More information about the llvm-dev mailing list