clang configure should default to native processor
| Bugzilla Link | 2051 |
| Resolution | WONTFIX |
| Resolved on | Jun 13, 2012 13:23 |
| Version | 2.6 |
| OS | All |
| CC | @asl,@lattner,@echristo |
Extended Description
We should change the llvm-gcc configure process to build code for the current processor unless otherwise specified. This would allow users who have machines with SSE2+ to automatically get good FP code without having to explicitly specify it.
Ancient bug cleanup...
Not fixing llvm-gcc, and this works w/ Clang today.
Aye aye.
I don't think it is worth bothering with llvm-gcc. Clang should default to -march=native on linux in particular.
BTW: Do you mean clang or llvm-gcc btw?
But yeah, I can probably add some sort of --with-arch=native/-march=native support and just have llvm autodetect like we do for llc or something.
Yep, the target triple is autosensed, but processor features are not. For example, the t-t doesn't encode whether the processor has sse2 support. Those are set with --with-arch=nocona or whatever.
If you don't specify --build, --host or --target then you seem to get whatever matches your native machine. For example I never bother specifying those and I get i686-pc-linux-gnu with llvm-gcc-4.2. So are you sure there is anything to do here?
PS: I recall getting i386 with llvm-gcc-4.0 so maybe this is a 4.2 feature.
Ah right, does our 4.2 tree have -with-arch=native?
When we build it, we pass a --with-arch flag to configure. I just mean that if a --with-arch flag isn't set specifically, configure should infer it. I think mainline gcc has --with-arch=native, I just think that should be the default unless another one is specified.
This means that people who know what they're doing can get what they want, people who don't ... get what they probably want. :)
Recent gcc has -march=native, at least for x86. I guess it could be made the default.