[PATCH] D45180: libcalls must check for "RtLibUseGOT" metadata during simplification

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 2 17:54:06 PDT 2018


tmsriram added a comment.

In https://reviews.llvm.org/D45180#1055123, @espindola wrote:

> In https://reviews.llvm.org/D45180#1055103, @tmsriram wrote:
>
> > In https://reviews.llvm.org/D45180#1055100, @espindola wrote:
> >
> > > I am not sure I understand. Shouldn't this just copy nonlazybind from printf to puts?
> >
> >
> > I didn't see that happen anywhere,  inferLibFuncAttribues is where the attributes are added to the simplified function.
>
>
> So maybe this is the wrong place to make the change?
>
> Given that we have nonlazybind on each GV, if we are replacing the printf GV with the puts GV we should copy nonlazybind from one to the other.


This is not happening for any attribute of printf right now and some attributes simply cannot be copied over so this doesn't seem easy to do.

> Another option that would be consistent is to just not have nonlazybind and always use RtLibUseGOT in codegen.

I thought of this and I like the idea but "nonlazybind" attribute has always been there,  it wasn't added for fno-plt.  Not tagging these functions with that attribute seems wrong too.  We may have to completely get rid of "nonlazybind" attribute if we want to go the metadata way.  Note that RtLibFunctions were the exception as it is not possible to add this attribute to them.


https://reviews.llvm.org/D45180





More information about the llvm-commits mailing list