All backends now use the MC asm printer

In r198030 the last in tree backend was converted to use MCInst for
printing assembly. I removed support for the old printer in r198959.

Out of tree targets have to lower MachineInstr to MCInst to use the new printer.

Cheers,
Rafael

Awesome.

-eric

And there was much rejoicing.

-Jim

And it only took what? Three years? Well done, everyone!

--renato

Awesome! Congrats Rafael,

-Chris

Out of tree targets have to lower MachineInstr to MCInst to use the new printer.

Awesome! Congrats Rafael,

All credit to Venkatraman Govindaraju, I only noticed that the last
one had been converted.

Cheers,
Rafael

Are there any guidelines as to how the lowering should be done? I'd like to update the (defunct) Microblaze back end before I pull the latest TOT this week.

-Rich

In r198030 the last in tree backend was converted to use MCInst for
printing assembly. I removed support for the old printer in r198959.

Out of tree targets have to lower MachineInstr to MCInst to use the new
printer.

Cheers,
Rafael

Are there any guidelines as to how the lowering should be done? I'd like

to update the (defunct) Microblaze back end before I pull the latest TOT
this week.

Venkatraman, I'm guessing you still have this fresh in your memory. Would
you mind giving a hand? (bonus points for writing some documentation <
http://llvm.org/docs/SphinxQuickstartTemplate.html> :wink:

-- Sean Silva

In r198030 the last in tree backend was converted to use MCInst for
printing assembly. I removed support for the old printer in r198959.

Out of tree targets have to lower MachineInstr to MCInst to use the new
printer.

Cheers,
Rafael

Are there any guidelines as to how the lowering should be done? I'd like
to update the (defunct) Microblaze back end before I pull the latest TOT
this week.

Venkatraman, I'm guessing you still have this fresh in your memory. Would
you mind giving a hand? (bonus points for writing some documentation
<http://llvm.org/docs/SphinxQuickstartTemplate.html> :wink:

Here are the steps that I followed to implement the MCLowering in
SPARC backend.

1. Implement <Target>MCExpr.cpp
    Create a derived class of TargetMCExpr to handle target specific
expressions such as %hi, %lo etc. See examples in AArch64MCExpr.cpp,
SparcMCExpr.cpp etc.,

2. Implement <Target>MCStreamer.cpp if the target needs any special directives.
    See http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-October/066248.html
for further info.

3. Implement InstPrinter using TableGen-ed AsmWriter. (See examples in
lib/Target/<Target>/InstPrinter/)

4. Implement <Target>MCInstLower.cpp to lower MachineInstrs to MCInst.
   This is implemented by lowering MachineInstr operands to either
MCInst operands or MCExpr. Target specific expressions are lowered to
<Target>MCExpr objects.

5. Modify <Target>AsmPrinter to lower MachineInstrs to MCInst and emit
them using the MCStreamer.

6. Finally, register the InstPrinter and the MCStreamers in
<Target>MCTargetDesc.cpp

Hope that this helps.

  For MicroBlaze target, when it removed from the trunk, it is already
using the new MCInstPrinter. So, it may easier to update it.

Thanks,
Venkatraman

And it only took what? Three years? Well done, everyone!

Well, there is still some work to be done before I would call the
transition complete. A big part of the old logic is still present
behind PrintAsmOperand. On targets that have an asm parser (and all of
them should have one at some point), we should be parsing the inline
asm string and then printing the operands as with regular
instructions.

Cheers,
Rafael