[PATCH] D109513: [AsmPrinter, SystemZ] Allow target to add instructions before section is ended.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 10 07:55:24 PDT 2021


jonpa added a comment.

> Can't a back-end specific emitConstantPools hook just emit those into the .text section? It's called at the same point you proposed new hook would be called, so I thought it should be able to do the same thing ...

Ah, I guess that could work.

- Personally, I would like to see an 'emitSectionEndings()' in AsmPrinter, since there are already are the similar emitStartOfAsmFile() and emitEndOfAsmFile(). It seems to me good to have a clear point before the sections may be closed (and I made the mistake here myself to emit the EXRL target instructions in emitEndOfAsmFile() in the first place...).

- I also see that emitConstantPools() is called in AsmParser. That should not stop the SystemZ EXRL approach (the EXRLTargets2Sym map should then be empty I think), but it is still somewhat confusing -- I am not sure why that call is needed from there...

- For a target (like SystemZ) that does not need a custom MCTargetStreamer otherwise it is easier to overload an AsmPrinter method directly.

I could try and see how much extra code it would be to implement a MCTargetStreamer in SystemZ (and move the EXRLTargets2Sym map into it probably), but first I would like your opinions that this would actually be better...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109513/new/

https://reviews.llvm.org/D109513



More information about the llvm-commits mailing list