You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using namespace llvm;
SubtargetFeatures Features1;
int main (int argc, char **argv)
{
sys::getHostCPUName();
StringMap HostFeatures;
if (sys::getHostCPUFeatures(HostFeatures))
for (auto &F : HostFeatures)
Features1.AddFeature(F.first(), F.second);
printf("test %s", Features1.getString().c_str());
printf("\nsomething else\n");
return 0;
}
. It gives me such a set of CPU features:
I tried to update the capture-fcn-attributes.go file, like this:
var supportedTriples []string = []string{
"x86_64-unknown-linux-gnu",
"i686-pc-linux-gnu",
"aarch64-unknown-linux-gnu",
}
.
When I tried the generator
capture-fcn-attributes -o /tmp/cpu_feature_list
it generated me a broad list.
The header contained
Ubuntu clang version 11.0.0-++20200721055954+cebd637c886-1exp120200721161335.13
.
I found
// triple: i686-pc-linux-gnu
static const CpuAttrs attrs1[] = {
// first entry is default cpu
{ "i686", "+cx8,+x87"},
and (inside the hashmap)
{ "yonah", "+cx8,+fxsr,+mmx,+sse,+sse2,+sse3,+x87"},
, which is not what I have supported (for Intel Celeron M440).
Clang reports "unsupported CPU features" on any non-provided one.
So that is one big problem.
Next problem is that
const TripleCpus triples[] = {
{ "x86_64-unknown-linux-gnu", &attrs0[0] },
{ "i686-pc-linux-gnu", &attrs1[0] },
{ "aarch64-unknown-linux-gnu", &attrs2[0] },
{ "", nullptr } // sentinel
};
is not targeting to yonah, while llc is targeting it.
It is always some "default" CPU model and, in fact, your code never provided extraction of the CPU model (from llc).
To make my observation complete - I am providing what is generated via
capture-fcn-attributes -cpu yonah
:
// triple: x86_64-unknown-linux-gnu
static const CpuAttrs attrs0[] = {
// first entry is default cpu
{ "x86-64", "+cx8,+fxsr,+mmx,+sse,+sse2,+x87"},
{ "", "" } // sentinel
};
// triple: i686-pc-linux-gnu
static const CpuAttrs attrs1[] = {
// first entry is default cpu
{ "i686", "+cx8,+x87"},
{ "yonah", "+cx8,+fxsr,+mmx,+sse,+sse2,+sse3,+x87"},
{ "", "" } // sentinel
};
// triple: aarch64-unknown-linux-gnu
static const CpuAttrs attrs2[] = {
// first entry is default cpu
{ "generic", "+neon"},
{ "", "" } // sentinel
};
I understand that your strategy worked find on Intel based system-on-board machines - but didn't try something for AMD (yet).
Nevertheless I have these issues on i686 - so I am proposing to perform a review.
The text was updated successfully, but these errors were encountered:
This issue is related to https://go-review.googlesource.com/c/gollvm/+/274574
.
I think I have some misunderstanding on how you used to deal with CPU models, for LLVM.
First things first - I had success with using
I tried to update the capture-fcn-attributes.go file, like this:
When I tried the generator
and (inside the hashmap)
To make my observation complete - I am providing what is generated via
I tried
I understand that your strategy worked find on Intel based system-on-board machines - but didn't try something for AMD (yet).
Nevertheless I have these issues on i686 - so I am proposing to perform a review.
The text was updated successfully, but these errors were encountered: