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

Daniel Dunbar daniel at zuster.org
Sat Nov 14 02:04:43 PST 2009


Applied as r, with the extra StringMap include dropped. Thank you very
much, this has long been on my TODO list.

Are you also working on the target features part of this work?

On Sat, Nov 14, 2009 at 1:48 AM, Roman Divacky <rdivacky at freebsd.org> wrote:
> On Sat, Nov 14, 2009 at 01:46:21AM -0800, Chandler Carruth wrote:
>> On Sat, Nov 14, 2009 at 1:13 AM, Roman Divacky <rdivacky at freebsd.org> wrote:
>> > 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:

>> >> 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.
>>
>> I was thinking the other way around: expose this in libSystem so that
>> the X86 target can leverage it. I agree libSystem shouldn't depend on
>> libTarget.
>
> I know... I already did it like this but daniel preferred this way. I have
> to agree that this looks better

  http://llvm.org/bugs/show_bug.cgi?id=5389
has the relevant context for those late to the party.

Basically I want to eliminate any host specific code in the targets
themselves -- the frontend and tools should have complete control over
this. The idea is to add another routine to detect the set of
"features", and then move tools like the JIT and llc to use this if
they want to match the host, instead of relying on the backend to do
it.

 - Daniel

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?
>
> thnx!
>
> roman
>
> p.s. CC: me as I am not subscribed to llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>



More information about the llvm-commits mailing list