https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115777

--- Comment #18 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Paul Menzel from comment #17)
> @rguenth, it looks like this regressed again in trunk with commit
> bbb4d007316 (Avoid live code-generation for stmts kept as scalars) [1].
> 
> With 8192 elements instead of the 1024; time in µs:
> 
> │        flags         │  10  │  11  │   12   │   13   │   14   │   15   │ 
> 16   │ trunk │
> ├──────────────────────┼──────┼──────┼────────┼────────┼────────┼────────┼───
> ────┼───────┤
> │ -O2                  │ 9671 │ 9671 │ 121000 │ 121000 │ 121100 │ 121100 │
> 9674  │ 53110 │
> ├──────────────────────┼──────┼──────┼────────┼────────┼────────┼────────┼───
> ────┼───────┤
> │ -O2 -march=x86-64-v3 │ 9673 │ 9672 │ 121200 │ 121700 │ 121200 │ 122200 │
> 9681  │ 53110 │
> ├──────────────────────┼──────┼──────┼────────┼────────┼────────┼────────┼───
> ────┼───────┤
> │ -O2 -march=native    │ 9676 │ 9676 │ 121200 │ 121800 │ 121200 │ 122200 │
> 53120 │ 53120 │
> 
> 
> trunk is slow again at plain -O2, 5.5× slower than GCC 16.2. It now packs
> two values into a vector register with movd/punpckldq before storing them.
> 
> (GCC 12–15 are 12.5× slower than GCC 11. The cause is the one the PR
> describes: an 8-byte vector store followed by an overlapping vector load in
> the next iteration, which the CPU can't forward from the store. GCC 16 fixed
> the plain -O2 and -march=x86-64-v3 cases but is still 5.5× slower with
> -march=native.)
> 
> Should I create a new issue?
> 
> [1]: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=bbb4d007316

No need, it was never fully fixed but as comment#14 suggests only
-mtune=generic was.  I'll have a look again what happens.

Reply via email to