]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Revert part of r16-869-ge3d3d6d7d2c8ab
authorRichard Biener <rguenther@suse.de>
Fri, 6 Feb 2026 13:25:06 +0000 (14:25 +0100)
committerRichard Biener <rguenther@suse.de>
Sat, 7 Feb 2026 10:06:36 +0000 (11:06 +0100)
The following reverts part of the changes done by r16-869-ge3d3d6d7d2c8ab
which AFAICS was never posted on the mailing list.  The hunk reverted
adds extra costs for vector construction of AVX or AVX512 vectors
because Honza thought we're only adding 1 conversion for all constructs,
but in fact we're costing each individual unique scalar source used.

Noticed when investigating PR120234, but this does not affect it
since there it's all SSE sized operations.

Still this is a regression, though reading r16-869-ge3d3d6d7d2c8ab
commit message indicating "correct numbers regress benchmarks" might
make this somewhat dangerous.  Still r16-531-g37e61c793c1b22 already
made the constructor costs much more expensive for integers, so
this might compensate.

* config/i386/i386.cc (ix86_vector_costs::add_stmt_cost):
Remove double and triple accounting of GPR -> XMM moves
in construction of AVX and AVX512 vectors.

gcc/config/i386/i386.cc

index 42ae9ccb05186b4217d994aa88d3eeaa25292f23..8a54648337dcc218b456d6893f3a53ac13d0a7ec 100644 (file)
@@ -26422,21 +26422,7 @@ ix86_vector_costs::add_stmt_cost (int count, vect_cost_for_stmt kind,
                {
                  m_num_gpr_needed[where]++;
 
-                 int cost = COSTS_N_INSNS (ix86_cost->integer_to_sse) / 2;
-
-                 /* For integer construction, the number of actual GPR -> XMM
-                    moves will be somewhere between 0 and n.
-                    We do not have very good idea about actual number, since
-                    the source may be a constant, memory or a chain of
-                    instructions that will be later converted by
-                    scalar-to-vector pass.  */
-                 if (kind == vec_construct
-                     && GET_MODE_BITSIZE (mode) == 256)
-                   cost *= 2;
-                 else if (kind == vec_construct
-                          && GET_MODE_BITSIZE (mode) == 512)
-                   cost *= 3;
-                 stmt_cost += cost;
+                 stmt_cost += COSTS_N_INSNS (ix86_cost->integer_to_sse) / 2;
                }
            }
        }