[lto] make builtins go

Paolo Bonzini paolo.bonzini@lu.unisi.ch
Tue Dec 11 17:13:00 GMT 2007


>>> I don't think my suggestion prevents optimizing (2).  :-)   In the (2)
>>> case __builtin_sin will be serialized out, read in by LTO, and optimize.
>>
>> That makes sense.  I didn't know that we transform sin to
>> "__builtin_sin" even at "-O0".
> 
> We do not generally convert calls to sin() to calls to __builtin_sin(), but
> if the middle-end introduces new calls to sin it generally uses the
> builtin variant.  We would need to start doing so instead, to make Paolos
> suggestion work - which I think would be a sensible thing to do to address
> this problem.

What I meant was only happening at the boundary between LTO-write and 
LTO-read: we can skip optimization on "sin" at LTO time, and not lose 
anything for translation units not compiled with -fno-builtin-xyz, if we 
serialize every "sin" as "__builtin_sin".

But yes, it would make sense to do this translation much earlier than at 
serialization time, possibly even when building GENERIC.  Whether to do 
that in mainline and import it into LTO, or the other way round, I don't 
know; but if you guys are thinking of doing it in LTO only, well, for 
sure it's a more compelling change than adopting a new representation 
for CALL_EXPRs. :-)

Paolo



More information about the Gcc-patches mailing list