[llvm-commits] EmitLibCalls: check TargetLibraryInfo

Nuno Lopes nunoplopes at sapo.pt
Tue Jul 24 19:51:28 PDT 2012


> On Tue, Jul 24, 2012 at 7:27 PM, Nuno Lopes <nunoplopes at sapo.pt> wrote:
>>> On Tue, Jul 24, 2012 at 2:14 PM, Nuno Lopes <nunoplopes at sapo.pt> wrote:
>>>>
>>>> Hi,
>>>>
>>>> Please find in attach a patch that makes EmitLibCalls consult the
>>>> TargetLibraryInfo data before creating a call to a library function. It
>>>> makes these Emit*() functions return 0 if the function is not 
>>>> available.
>>>>
>>>> Any comments?
>>>
>>>
>>> The convention of returning null is dangerous, as demonstrated by the
>>> fact that you messed it up in multiple places.  Maybe use
>>> llvm::Optional?
>>>
>>> Otherwise, looks fine.
>>
>>
>> Thanks for the review!
>> Actually returning null is really convenient in a number of places, since
>> instcombine and simplifylibcalls interpret the return of null as "didn't
>> change anything".
>
> Hmm... I guess it's okay, then.
>
>> I've hopefully audited all call sites.
>
> Did you mean to attach a new version?

Actually no :)
I think I didn't do any change after I sent the patch. I'll commit it 
tomorrow morning.
Nuno 




More information about the llvm-commits mailing list