[llvm] r242558 - MergeFuncs: Transfer the function parameter attributes to the call site

Nick Lewycky nicholas at mxc.ca
Sun Jul 19 12:56:57 PDT 2015


Arnold Schwaighofer wrote:
> Reverted.
>
>
>> On Jul 19, 2015, at 12:16 PM, Arnold<aschwaighofer at apple.com>  wrote:
>>
>>
>>
>> Sent from my iPhone
>>
>>> On Jul 19, 2015, at 12:03 PM, Nick Lewycky<nicholas at mxc.ca>  wrote:
>>>
>>> Pete Cooper wrote:
>>>>
>>>>> On Jul 19, 2015, at 10:45 AM, Arnold<aschwaighofer at apple.com
>>>>> <mailto:aschwaighofer at apple.com>>  wrote:
>>>>>
>>>>> Given that we can call function pointers it seems to make sense to me
>>>>> to require to have (especially ABI changing) parameter attributes on
>>>>> the call site.
>>>> Absolutely.
>>>
>>> Yes, there is a surprise in LLVM IR: if you take a direct call and turn it into an indirect call on the same callee, you may change how that call is made in ABI-affecting ways. This is just a fact of life for whoever wants to do such a transform. However, this isn't the case regarding this commit to mergefunc.
>>>
>>
>> So I misread the LangRef an transferring the parameter attributes is not required?
>
>
> If that is so then a bug is that MergeFunctions only looks at a CallInst’s attribute when comparing CallInsts instead of also looking at the called function when available. Don’t know if that is my bug yet will have to look on monday.

Sure, but MergeFunctions does it in a very efficient way: it checks 
whether the called Function* is the same. Clearly if two calls are 
calling the same function, then the attributes on the function don't 
need the be compared. The only thing left to check is the attributes on 
the call itself.




More information about the llvm-commits mailing list