[llvm-commits] r55638 - /llvm/trunk/include/llvm/Function.h

Duncan Sands baldrick at free.fr
Fri Sep 26 13:11:37 PDT 2008


> > How about this instead: have sse be a tri-state
> > "sse", "no-sse" or don't care.  Have the inliner
> > refuse to inline function B into function A if
> > they have conflicting notes ("sse" conflicts with
> > "no-sse", but "don't care" doesn't conflict with
> > anything).
> 
> I do not understand, why the inliner can not inline a function marked  
> as "x86.no-sse" into a function marked as "x86.sse"?  After all it is  
> not "x86.sse.only" :)

Remember that it's a tri-state: no-sse doesn't mean "didn't specify
sse", it means "explicitly said no sse".  If the user went to the
trouble of explicitly saying "do not use sse for this function" it
seems unwise to ignore that.

Maybe the example of a frame-pointer is clearer.  I think it's
fairly common that people want to explicitly compile some functions
with a frame pointer in order to help with debugging.  It seems
reasonable to me that the inliner should refuse to inline a function
with an explicitly requested "give this guy a frame pointer" into
a function with an explicitly requested "don't give this guy a
frame pointer".

And don't forget the big advantage of this scheme: it may not be
perfect but it is extremely simple and uniform (can work the same
for a bunch of codegen options).  And the inliner doesn't need to
know about special sse intrinsics, vector instructions, asm requiring
a frame pointer etc.

Ciao,

Duncan.



More information about the llvm-commits mailing list