[llvm-commits] [PATCH] LTO code generator options

Devang Patel devang.patel at gmail.com
Mon Nov 30 09:54:48 PST 2009


On Thu, Nov 26, 2009 at 2:15 PM, Nick Lewycky <nicholas at mxc.ca> wrote:
> Devang Patel wrote:
>>
>> 3 - It is quite reasonable for some to put two copies of a function,
>> one for SSE3 machines, one for non-SSE machines, in one bitcode file
>> and let code generator generate appropriate code for each functions so
>> that the user can select desired function at run time. At Apple, we
>> supported similar requirements for Altivec vs. non-Altivec code. This
>> can be achieved if subtarget features like SSE3 are encoded in bitcode
>> files.
>
> Now that's an interesting idea. There's one obvious major issue with it,
> which is that we would end up with two different function definitions with
> the same name.

Name does not need to match to generate CPU specific code for each
function in one object file! If user is inserting runtime check to
invoke specific function then user took care of function names. If the
compiler is inserting runtime check to invoke optimized function the
compiler should do the right thing.

> Assuming we can overcome that, we then run into issues with
> (for example) the inliner being unable to inline a function because it
> doesn't know what the subtarget is.

We discussed at length (may be I am understating this :), what inliner
should do. Summary, when such functino attributes are introduced, the
inliner must be updated to do the right thing.

-
Devang



More information about the llvm-commits mailing list