This is an archive of the discontinued LLVM Phabricator instance.

[cpu-detection] [amdfam10] Return barcelona, and amdfam10 for all other subtypes. Address Bug 28067.
ClosedPublic

Authored by asbirlea on Jun 9 2016, 11:41 AM.

Details

Summary

Along with the refactoring of Host.cpp, getHostCPUName() was modified to return more precise types for CPUs in amdfam10.
However, callers of getHostCPUName() do string matching on type, so this cannot be modified.
Currently there is support in the x86 backend for barcelona.
For all other subtypes the assumed return value is amdfam10.

Fix: getHostCPUName() returns barcelona subtype and amdfam10 for all others. This can be extended further when support for the other subtypes is added.

Diff Detail

Repository
rL LLVM

Event Timeline

asbirlea updated this revision to Diff 60218.Jun 9 2016, 11:41 AM
asbirlea retitled this revision from to [cpu-detection] Return amdfam10 for all subtypes. Address Bug 28067..
asbirlea updated this object.
asbirlea added reviewers: llvm-commits, echristo.
echristo edited edge metadata.Jun 9 2016, 2:09 PM

Can you elaborate on your summary? What's going on, why is this correct, what does it fix? Basically trying to make sure that the text committed says what's going on and why a change was made rather than what you're doing.

-eric

asbirlea updated this object.Jun 9 2016, 2:13 PM
asbirlea edited edge metadata.

So, we already have support for barcelona, etc in the x86 backend. Perhaps we should just update the callers to remove the amdfam10- from the prefix in order to pass things down further? Take it as an alias to the cpu? Should it just return "barcelona" instead? (Will that end up causing incompatibility problems in compiler-rt? Might if we're not compatible that way).

-eric

asbirlea updated this revision to Diff 60248.Jun 9 2016, 3:04 PM

There is support in the x86 backend for barcelona, gcc's options include it and all uses I found test for it.
For all other subtypes the assumed return value is amdfam10.
So, keep barcelona subtype and return amdfam10 for all others (this can be extended further when support for the other subtypes is added).

Seems reasonable for now. Can you update the summary (and commit message) accordingly please?

Thanks!

-eric

asbirlea retitled this revision from [cpu-detection] Return amdfam10 for all subtypes. Address Bug 28067. to [cpu-detection] [amdfam10] Return barcelona, and amdfam10 for all other subtypes. Address Bug 28067..Jun 9 2016, 3:26 PM
asbirlea updated this object.
echristo accepted this revision.Jun 9 2016, 3:39 PM
echristo edited edge metadata.

OK. Thanks!

-eric

This revision is now accepted and ready to land.Jun 9 2016, 3:39 PM
asbirlea updated this object.Jun 9 2016, 3:40 PM
asbirlea edited edge metadata.
This revision was automatically updated to reflect the committed changes.