[PATCH] Support asm comment output

JITs do use MachineInstr though, so making them large or more expensive impacts a JIT.


Ugh. I just found another case I don't think we can synthesize in asmprinter.
We mark rematerialized instructions as well so our performance guys don't come
and ask us why we didn't hoist saomething out of a loop. :slight_smile:

We're also a bit more expressive in our spill/reload marking. For example,
we're mark whether a spill or reload was merged with another instruction
and mark copy instructions that were inserted because the spiller could
reuse a previous reload. These are all extra things the spiller inserts. We
might be able to get folded spill/reload information synthesized by looking
at MachineOperands but I don't think we can get reuse copies or rematted

Would it be acceptable to add a small flags field to MachineInstr that we
can use as a bitvector?


In fact I think I can put a short between the NumImplicitOps and the Operands
fields and not increase MachineInstr size on most architectures.


Here's another question. If we mark StackObjects as spill slots, isn't it
possible that stack slot coloring could come along and assign non-spill/reload
memory objects to the same slot? If so, it would appear we really do need
a flag on MachineInstr to notate all spills and reloads.


Dave, lets start with the simple stuff and get it working first. We can feature creep it after that :slight_smile:


David Greene wrote:

In JIT compilers anything that slows down compilation is BAD. Plus most
VMs already have there own debug/introspection infrastructure, so none
is required in the machine code.

JITs don't generate asm.

Indeed yes. But the JIT does still take the IR, and if that takes longer to create and process, then it is bad.

Obviously the ideal is some sort of annotations that have practically zero cost if they are not used.

Well, ok, but this other stuff is going to be coming pretty quickly.