[llvm-dev] How to get assembly opcode mnemonic(s) corresponding to a MachineInstr?

Radhika via llvm-dev llvm-dev at lists.llvm.org
Sat Feb 4 14:19:08 PST 2017


Hi,

I'd like to modify MachineBasicBlock contents within a
MachineFunctionPass on the basis of how many CPU cycles the assembly
instructions corresponding to the MBB take. I'm using the AVR backend
and the number of CPU cycles every AVR assembly operation takes is
openly available.

Is there any straightforward way of getting the opcode mnemonics
corresponding to a MachineInstr? I've gone through this thread
(http://lists.llvm.org/pipermail/llvm-dev/2012-October/054818.html)
and I understand I need to modify the AsmPrinter or InstPrinter in
some way, but am not sure how.

Thank you for your help!

Radhika


More information about the llvm-dev mailing list