[cfe-dev] Why optimize AvailableExternallyLinkage functions when codegenning?

David Chisnall via cfe-dev cfe-dev at lists.llvm.org
Tue Sep 1 04:59:33 PDT 2015

AvailableExternally functions are available for inlining, if inlining them makes sense.  The inliner makes better decisions after some early optimisation (SROA, CSE, at least).  We can’t rely on this having been done prior to (partial) linking.


> On 1 Sep 2015, at 10:00, Yaron Keren via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> AvailableExternallyLinkage functions are not emitted when codegenning, do they really need to go through optimization passes?
> I tried testing with 
> bool FPPassManager::runOnFunction(Function &F) {
>   if (F.isDeclaration() || F.hasAvailableExternallyLinkage())
> which failed only one test, LLVM :: CodeGen/X86/hidden-vis-pic.ll, so there is some issue which yet may be solved without doing all the passes.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

More information about the cfe-dev mailing list