wenlei added a comment.

In D77484#1965976 <https://reviews.llvm.org/D77484#1965976>, @tejohnson wrote:

> In D77484#1965629 <https://reviews.llvm.org/D77484#1965629>, @wenlei wrote:
>
> > > Ok then it does sound like these could be handled on a per-function 
> > > basis, similar to how -fno-builtin* are handled. I.e. a function 
> > > attribute to indicate the veclib, which would then be naturally preserved 
> > > during LTO even after merging/importing across modules. Similar to how 
> > > -fno-builtin* are handled, these would need to be examined when inlining 
> > > (see the new TargetLibraryInfo::areInlineCompatible). Presumably we would 
> > > want to block inlining between functions with different veclib attributes 
> > > in the LTO backends.
> >
> > @tejohnson, we could do that. But then on the other hand, technically 
> > almost everything for module or whole program can be passed as a function 
> > attribute, and yet we have switches passed to backend for many of those 
> > things. Wondering what's the convention or rule (if there's one) we want to 
> > follow? Specifically, if we only use function attributes for stuff that's 
> > indeed going to be different between functions, then vectlib isn't in that 
> > category; or if we use function attributes for the greatest flexibility 
> > whenever we can, then many other things should be function attributes too 
> > (though it's essentially duplication in IR, and probably not the most 
> > efficient).
>
>
> Passing the option through the driver to the linker is the legacy approach. 
> But it isn't really scalable and has other issues, so we've been moving 
> towards having all the necessary info in the IR itself. For one, this helps 
> deal with cases where different options were specified for different source 
> files. For another, it keeps the same build behavior with LTO and non-LTO. 
> I.e. for this option, if the build system specified it for the cc compiles 
> but not the links, it would work for O2 
> <https://reviews.llvm.org/owners/package/2/> but not for LTO if it had to be 
> propagated via the linker. It would work for LTO if it was propagated via the 
> IR.


Makes sense, thanks for clarification. I created D77632 
<https://reviews.llvm.org/D77632> to make vect lib setting a per-function 
attribute.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77484



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to