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

Nick Lewycky nicholas at mxc.ca
Thu Nov 26 14:15:58 PST 2009


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. 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.

Otherwise, this 'fat llvm ir' sounds like it would work, if that's what 
you really wanted to do-- which I don't think it is. I have trouble 
creating an argument for why it's bad, but I note that this is contrary 
to the way LLVM has approached portability thus far.

Nick



More information about the llvm-commits mailing list