diff options
author | Roger Sayle <roger@nextmovesoftware.com> | 2024-01-07 17:42:00 +0000 |
---|---|---|
committer | Roger Sayle <roger@nextmovesoftware.com> | 2024-01-07 17:42:00 +0000 |
commit | 0a8aba760f62e9d66cc5610ecc276c1f0befc651 (patch) | |
tree | 3a93f53f9966a910413b4127afbdde17d41b98df /libgfortran/io/write.c | |
parent | d9dd04f9f17e36854387899eb630c64a0c8d1a17 (diff) | |
download | gcc-0a8aba760f62e9d66cc5610ecc276c1f0befc651.zip gcc-0a8aba760f62e9d66cc5610ecc276c1f0befc651.tar.gz gcc-0a8aba760f62e9d66cc5610ecc276c1f0befc651.tar.bz2 |
i386: PR target/113231: Improved costs in Scalar-To-Vector (STV) pass.
This patch improves the cost/gain calculation used during the i386 backend's
SImode/DImode scalar-to-vector (STV) conversion pass. The current code
handles loads and stores, but doesn't consider that converting other
scalar operations with a memory destination, requires an explicit load
before and an explicit store after the vector equivalent.
To ease the review, the significant change looks like:
/* For operations on memory operands, include the overhead
of explicit load and store instructions. */
if (MEM_P (dst))
igain += !optimize_insn_for_size_p ()
? -COSTS_N_BYTES (8);
: (m * (ix86_cost->int_load[2]
+ ix86_cost->int_store[2])
- (ix86_cost->sse_load[sse_cost_idx] +
ix86_cost->sse_store[sse_cost_idx]));
however the patch itself is complicated by a change in indentation
which leads to a number of lines with only whitespace changes.
For architectures where integer load/store costs are the same as
vector load/store costs, there should be no change without -Os/-Oz.
2024-01-07 Roger Sayle <roger@nextmovesoftware.com>
Uros Bizjak <ubizjak@gmail.com>
gcc/ChangeLog
PR target/113231
* config/i386/i386-features.cc (compute_convert_gain): Include
the overhead of explicit load and store (movd) instructions when
converting non-store scalar operations with memory destinations.
Various indentation whitespace fixes.
gcc/testsuite/ChangeLog
PR target/113231
* gcc.target/i386/pr113231.c: New test case.
Diffstat (limited to 'libgfortran/io/write.c')
0 files changed, 0 insertions, 0 deletions