llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

clang configure should default to native processor

Open lattner opened this issue 18 years ago • 9 comments

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.

lattner avatar Feb 16 '08 22:02 lattner

Ancient bug cleanup...

Not fixing llvm-gcc, and this works w/ Clang today.

chandlerc avatar Jun 13 '12 20:06 chandlerc

Aye aye.

echristo avatar Dec 03 '10 08:12 echristo

I don't think it is worth bothering with llvm-gcc. Clang should default to -march=native on linux in particular.

lattner avatar Dec 03 '10 08:12 lattner

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.

echristo avatar Dec 03 '10 08:12 echristo

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.

lattner avatar Feb 18 '08 19:02 lattner

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.

llvmbot avatar Feb 18 '08 14:02 llvmbot

Ah right, does our 4.2 tree have -with-arch=native?

lattner avatar Feb 16 '08 22:02 lattner

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

lattner avatar Feb 16 '08 22:02 lattner

Recent gcc has -march=native, at least for x86. I guess it could be made the default.

llvmbot avatar Feb 16 '08 22:02 llvmbot