[cfe-commits] r88819 - in /cfe/trunk: lib/Driver/Tools.cpp test/Driver/clang-translation.c

Chris Lattner clattner at apple.com
Mon Nov 23 09:11:29 PST 2009


On Nov 22, 2009, at 9:22 AM, Daniel Dunbar wrote:

> On Sun, Nov 22, 2009 at 7:26 AM, Chris Lattner <clattner at apple.com> wrote:
>> 
>> On Nov 14, 2009, at 2:04 PM, Daniel Dunbar wrote:
>> 
>>> Author: ddunbar
>>> Date: Sat Nov 14 16:04:54 2009
>>> New Revision: 88819
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=88819&view=rev
>>> Log:
>>> Add clang -mcpu=native support, patch by Roman Divacky, varioustweaks by me.
>>> - We still need support for detecting the target features, since the name
>>>   doesn't actually do a good job of decribing what the CPU supports (for LLVM).
>> 
>> Very cool.  Should this be the default on linux and BSDs?
> 
> I personally think -march=native is not the right default, but I see
> the arguments for it. I guess the argument for making it the default
> on Linux/BSDs is that many users build their own software?

Yes, that is the biggest argument.  The other issue is that the normal fallback is plain i386 which lacks SSE2.  We should default to at *least* pentium4 if you don't want native.  However, I don't see why native is bad. We should allow (though not a priority) clang to be configured to default to a specific target which may not be the native one at all, this mechanism should handle the case where I want to build for i386 on my penryn.

> What do modern GCC's do?

No idea, and I don't think it is really relevant.  We should do the 'right thing' here even if it is a bit surprising to some people (like defaulting to c99 instead of c89).  These is highly unlikely to be a compatibility problem so I see little reason not to do it.

> 
> We also need to finish off some of the feature detection before this
> feature works solidly.

Ok, no rush then!

-Chris



More information about the cfe-commits mailing list