]> git.ipfire.org Git - thirdparty/gcc.git/commit
Make ix86 cost of VEC_SELECT equivalent to SUBREG cost 1
authorJan Hubicka <hubicka@ucw.cz>
Fri, 2 May 2025 13:53:35 +0000 (15:53 +0200)
committerJan Hubicka <hubicka@ucw.cz>
Fri, 2 May 2025 13:54:23 +0000 (15:54 +0200)
commitc85148d036d17295bb2560e10020c924c83a5d13
tree8eb00da0d387a38582f8443c2d564d82615f1823
parent2d7a0d38e2f8e281ab2269cfe6c048410fa3c886
Make ix86 cost of VEC_SELECT equivalent to SUBREG cost 1

This patch fixes regression of imagick with PGO and AVX512 where correcting size
cost of SSE operations (to be 4 instead of 2 originally cut&pasted from x87)
made late combine to eliminate zero registers introduced by rapd.  The problem
is that cost-model mistakely accounts VEC_SELECT as real instruction while it is
optimized to nothing if src==dest (which is the case of these testcases).
This register is used to eliminate false dependency between source and destination
of int->fp conversions.

While ix86_insn_cost hook already contains logic to incrase cost of the zero-extend
the costs was not enough.

gcc/ChangeLog:

PR target/119900
* config/i386/i386.cc (ix86_can_change_mode_class): Add TODO
comment.
(ix86_rtx_costs): Make VEC_SELECT equivalent to SUBREG cost 1.
gcc/config/i386/i386.cc