[cfe-dev] Driver: Default CPUs
James Molloy
james.molloy at arm.com
Wed Oct 12 02:40:12 PDT 2011
Hi,
I'm kicking off this discussion as it came out of my previous thread on ARM
Driver cleanup that people had different opinions on the use of default
CPUs.
The driver, currently, *always* sets the "-target-cpu" option to cc1. The
way it finds a default CPU for an architecture is hardcoded and nasty, and
I'd love to get rid of it.
My personal opinion is that there should be no need to set a default CPU all
the time. The target triple should suffice, and if the user wants
performance tuned to a specific CPU they should mention that on the
commandline with -mcpu= or -mtune=. If no CPU is specified, I feel that a
"blended" scheduling should be done such that the resultant code runs well
on all chips with the given architecture/triple.
The fact that LLVM doesn't have many processor itineraries (especially for
ARM) and can't currently do this shouldn't really factor in to this
discussion - I'd like this discussion to be more what we *should* do, not
what we *can* do with the current constraints. We can then take the outcomes
of it and see concretely what we may need to change.
Also, I'm not considering backwards compatibility for Darwin here - any
solution will take "Darwin as a special case" into account.
The arguments I've heard so far are:
* Mine, that there should be no default CPU selected if the user doesn't
select it himself. I feel it adds a hidden option that the user is unaware
of, and depending on what that default is may cause inferior performance on
the CPU the user actually runs it on.
* Jim's (? I forget who responded ?), that there *should* be a default CPU
all the time, but perhaps some pseudo-CPUs could be added that exhibit a
blended scheduling. For example for ARM, a "v7" pseudo-cpu could be added
that has an itinerary that performs well on all v7 cores. By the way, I
think ARM is the only high-visibility target with such a difference between
cores that this matters. I assume MIPS and PowerPC are similar though?
* Keep the current behaviour and select a default CPU for the given
architecture.
* ???
Out of all of these, the only one I really dislike is keeping the current
behaviour.
What do people think? Do people care?
Cheers,
James
More information about the cfe-dev
mailing list