[llvm-dev] [RFC] Propeller: A frame work for Post Link Optimizations

Kristof Beyls via llvm-dev
Fri, 27 Sep 2019 07:37:15 -0000

Op vr 27 sep. 2019 om 02:32 schreef Sriraman Tallam via llvm-dev <
llvm-dev at lists.llvm.org>:

> >
> > If you have the MIR at the time you're making all the propeller
> optimization decisions, why is the linker rewriting raw x86 assembly, as
> opposed to performing the relevant transforms on MIR?
>
> MIR is still one module at a time.  We cannot do inter-procedural
> basic block layout here.  We can do much more advanced stuff at the
> whole-program level in the linker.  The relaxation code is the down
> side.
>
> For more details, We strongly considered this.  We could run something
> like a thin link in thin lto figure out the global layout and hand out
> the relevant  subsets of the global decision  to each module.  This
> looked more complicated and the individual pieces from each module
> should still be globally laid out again by the linker.  This
> constraints us on what we can do for layout and also does not work
> well with future optimizations like global alignment like David
> pointed out.
>

Apologies for the naive question.
Why is MIR restricted to being only module at a time?
If the restriction of only being able to do per-module processing at the
MIR level would go away, then all these optimizations could be done in a
compile step, and no support would need to be added to a linker?
If the restriction to do cross-module optimization at the MIR level could
be removed, would it become a better tradeoff to do this in an LTO compiler
step rather than a linker step?

Thanks,

Kristof
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20190927/45f1471c/attachment.html>