[llvm-dev] grouping global variables by alignment: safe to do at LLVM level, or only at Clang level?

Abe Skolnik via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 25 16:57:10 PDT 2016


Dear Kevin,

Thanks for your quick and thoughtful reply.

Please tell me whether or not I have understood you correctly: I think what you are saying is 
that it might be possible to do what I`m talking about at the LLVM level, have it turned off by 
default so it`s safe, have Clang turn it on when the optimization level says to do so [since 
AFAIK all Clang-supported languages allow compilers to re-order globals], and let other front 
ends turn it on if their respective language specifications also allow compilers to re-order 
globals.

If that`s a correct understanding, then I think that`s a great idea.  Thanks either way, i.e. 
even if I _have_ misunderstood. ;-)

Regards,

Abe






On 07/25/2016 06:52 PM, Kevin Choi wrote:

> Hi Abe,

> I don't see why you couldn't make a frontend query in the pass-manager to
> selectively enable such globals reordering/aligning pass. If this is a
> discouraged practice noted in docs somewhere and LLVM's goal is to be truly
> frontend/platform agnostic, please do correct me. AFAIK, Pass Manager
> selects some optimizations based on Optimization Levels (-O2,-O3,etc), so
> extending this shouldn't be a challenge.

> Regards,
> Kevin


More information about the llvm-dev mailing list