New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'-march=native' incorrectly emits VZEROUPPER with Knights Landing #35967
Comments
Can you provide an IR file so we can see what CPU it was detected as? Also if you could provide a copy of /proc/cpuinfo from the system if you're on linux. |
$ cat /proc/cpuinfo ... repeated 72 times because, well, that is how /proc/cpuinfo works ... $ clang -O3 -march=native -S -o - -emit-llvm /tmp/phi_test.cpp %class.BigThing = type { [8 x i32] } ; Function Attrs: nounwind uwtable ; Function Attrs: argmemonly nounwind attributes #0 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="bdver1" "target-features"="+adx,+aes,+avx,+avx2,+avx512cd,+avx512er,+avx512f,+avx512pf,+bmi,+bmi2,+cmov,+cx16,+f16c,+fma,+fsgsbase,+fxsr,+lzcnt,+mmx,+movbe,+pclmul,+popcnt,+prefetchwt1,+prfchw,+rdrnd,+rdseed,+sahf,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87,+xsave,+xsaveopt,-avx512bitalg,-avx512bw,-avx512dq,-avx512ifma,-avx512vbmi,-avx512vbmi2,-avx512vl,-avx512vnni,-avx512vpopcntdq,-clflushopt,-clwb,-clzero,-fma4,-gfni,-ibt,-lwp,-mwaitx,-pku,-rdpid,-rtm,-sgx,-sha,-shstk,-sse4a,-tbm,-vaes,-vpclmulqdq,-xop,-xsavec,-xsaves" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.module.flags = !{#0} !0 = !{i32 1, !"wchar_size", i32 4} |
PS – Thanks Craig for being so responsive to bug reports :-) |
Well this is a scary bug. KNL is being identified as "bdver1". Silvermont gets identified as "amdfam10h" I think. |
Fix commited in r326840 |
Hopefully we can get this into the next 6.0 branch release |
Merged: r329473 |
mentioned in issue #35997 |
Extended Description
The following code compiled on Knights Landing incorrectly generates VZEROUPPER with '-march=native', and correctly does NOT emit VZEROUPPER with '-march=knl':
class alignas(32) BigThing { int i[8]; };
void test(BigThing *in, BigThing *out) { *out = *in; }
The text was updated successfully, but these errors were encountered: