Patch takes advantage of the implicit default behavior to reduce the number of attributes, which in turns reduces compilation time.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I checked the usage of this attribute, and it's indeed ignored when set to zero, so yeah, let's just not generate it in that case.
Comment Actions
This commit will decrease the frequence of intel CPU, causing a performance regression.
clang/lib/CodeGen/CodeGenFunction.cpp | ||
---|---|---|
496 | For x86 backend, "LargestVectorWidth" default value is not zero but UINT32_MAX. |
clang/lib/CodeGen/CodeGenFunction.cpp | ||
---|---|---|
496 | Reproducer please? |
clang/lib/CodeGen/CodeGenFunction.cpp | ||
---|---|---|
496 | $ cat test.c void foo(float* in, float* __restrict out, int n) { int i; for (i = 0; i < n; i++) { out[i] = i + 2*in[i]; } } Before this patch $ clang -Ofast -march=skylake-avx512 -mllvm -force-vector-width=16 -mprefer-vector-width=256 -S -o - test.c | grep ymm | wc 57 333 2687 After this patch $ clang -Ofast -march=skylake-avx512 -mllvm -force-vector-width=16 -mprefer-vector-width=256 -S -o - test.c | grep ymm | wc 0 0 0 |
clang/lib/CodeGen/CodeGenFunction.cpp | ||
---|---|---|
496 | Hello, reverted. https://reviews.llvm.org/rG2cb8c10342ee5d040725abb1166feb92a64c7df6 It would be good to somehow make a test to not regress in the future, but not sure how, as we have no "C -> X86 asm" tests? |