[llvm-commits] move CPU detection from lib/Target/$FOO to libSystem

Roman Divacky rdivacky at freebsd.org
Sat Nov 14 01:13:08 PST 2009


On Fri, Nov 13, 2009 at 10:18:31PM -0800, Chandler Carruth wrote:
> On Fri, Nov 13, 2009 at 3:48 AM, Roman Divacky <rdivacky at freebsd.org> wrote:
> > hi
> >
> > the attached patch moves cpu detection code from lib/Target/$FOO
> > (for FOO=X86 :) ) to lib/System. This is necessary for clang
> > to be able to do -march=native. The patch was already reviewed
> > by Daniel Dunbar.
> >
> > Can you please review/commit this?
> 
> A meta-point: you're moving a lot more than just GetCurrentX86CPU into
> libSystem, can you expose the other functions and delete the copies in
> X86Subtarget? I'd rather avoid duplicating subtle code like that.
 
I was told to not expose any target specific functionality, the
GetX86CpuIDAndInfo and DetectX86FamilyModel are fairly small and not
likely to change often. I dont like the duplication either butcant think of
any way to reach this X86 specific stuff from libSystem.

> Also, why add the include on StringMap?

oh.. leftover from previous attempts :)

new patch attached

thnx for review!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-march=native.patch
Type: text/x-diff
Size: 10585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20091114/11117492/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20091114/11117492/attachment.sig>


More information about the llvm-commits mailing list