MC-aware Asm Printers

I’m in the process of evaluating whether to make the PTX assembly printer MC-aware. It appears that most other back-ends have made the switch, but I want to evaluate if it makes sense for the PTX back-end. First, PTX is a text-only format; there are no instruction encodings or object files. Second, the PTX back-end will never tie into the JIT compiler.

After experimenting with the conversion a bit, the main problem I’m having right now is that MCInst instances do not tie back to a MachineFunction, which is required (at least without severe hacks) in the PTX back-end to refer back to the MachineFunctionInfo struct for register names, etc. I’m sure there are ways around this, but it would be a substantial up-front effort.

With that said, what are the advantages of making a back-end assembly printer MC-aware? Is it even worth the effort for this back-end, given its rather unique constraints? The default AsmPrinter method is working fine, I’m just concerned that back-ends will be required to be MC-aware at some point in the future, making the switch inevitable.

I believe that this is likely going to be the case.

-eric