[PATCH] D68065: Propeller: LLD Support for Basic Block Sections

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 7 10:08:16 PST 2020


MaskRay added a comment.

In D68065#1863669 <https://reviews.llvm.org/D68065#1863669>, @ruiu wrote:

> Here is a summary of today's discussion:
>
> - this seems a straightforward implementation of your proposal
> - this patch introduces a new notion of "Jump Relocations" to represent data related to rewriting jump instructions at end of sections. Even though the Jump Relocations are somewhat similar to existing Relocations, but they are maintained in different arrays, and they are handled and consumed by different code locations. So maybe we should avoid calling it a "relocation" because "jump relocations" aren't relocations in object files?


So you had a discussion about this:)

I attended a LLVM Social yesterday and asked some people about their feelings. We are still dubious whether doing all the heavy lifting on the linker side is the right approach. Disassembly at linker side may give some short term benefits, but the interaction with debug info/asynchronous unwind tables/symbol information is muddy. The improvement is fixed. Linkers don't really understand the semantics, so the available optimizations are rather limited. In a long term, this can cause some maintenance burden. I can think of several problems:

- Needs a psABI defined relocation type. The relocation type will probably have no use other than this very specific optimization.
- Needs non-trivial work to port to COFF.
- Another target may be a very different story.
- This duplicates some work of MachineBlockPlacement.
- The code will be duplicated on lld side may be a lot. `emitNops` can be reused with AsmPrinter. Branch terminators optimization may be reused with BranchFolding. etc It the current MachineFunction interface does not allow  sharable MachineBasicBlocks with other MachineFunctions. Fix it.

I will send a reply to llvm-dev.


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

https://reviews.llvm.org/D68065





More information about the llvm-commits mailing list