public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/7][x86] Remove vcond{,u,eq}<mode> expanders.
@ 2024-06-27  8:23 liuhongt
  2024-06-27  8:23 ` [PATCH 1/7] [x86] Add more splitters to match (unspec [op1 op2 (gt op3 constm1_operand)] UNSPEC_BLENDV) liuhongt
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: liuhongt @ 2024-06-27  8:23 UTC (permalink / raw)
  To: gcc-patches; +Cc: crazylht, hjl.tools

There're several regressions after obsolete vcond{,u,eq}<mode>,
Some regressions are due to the direct optimizations in
ix86_expand_{fp,int}_vcond..i.e ix86_expand_sse_fp_minmax.
Some regrssions are due to optimizations relies on canonicalization
in ix86_expand_{fp,int}_vcond.

This series add define_split or define_insn_and_split to restore
those optimizations at pass_combine. It fixed most regressions in GCC
testsuite except for ones compiled w/o sse4.1. W/o sse4.1 it takes 3
instrution for vector condition move, and pass_combine only supports
at most 4 instructions combination. One possible solution is add fake
"ssemovcc" instructions to help combine, and split that back to real
instruction. This series doesn't handle that, but just adjust testcases
to XFAIL.

I also test performance on SPEC2017 with different options set.
-march=sapphirerapids -O2
-march=x86-64-v3 -O2
-march=x86-64 -O2
-march=sapphirerapids -O2
Didn't observe obvious performance change, mostly same binaries.

Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}.
Any comments?

liuhongt (7):
  [x86] Add more splitters to match (unspec [op1 op2 (gt op3
    constm1_operand)] UNSPEC_BLENDV)
  Lower AVX512 kmask comparison back to AVX2 comparison when
    op_{true,false} is vector -1/0.
  [x86] Match IEEE min/max with UNSPEC_IEEE_{MIN,MAX}.
  Add more splitter for mskmov with avx512 comparison.
  Adjust testcase for the regressed testcases after obsolete of
    vcond{,u,eq}.
  [x86] Optimize a < 0 ? -1 : 0 to (signed)a >> 31.
  Remove vcond{,u,eq}<mode> expanders since they will be obsolete.

 gcc/config/i386/mmx.md                        | 149 ++--
 gcc/config/i386/sse.md                        | 772 +++++++++++++-----
 gcc/testsuite/g++.target/i386/avx2-pr115517.C |  60 ++
 .../g++.target/i386/avx512-pr115517.C         |  70 ++
 gcc/testsuite/g++.target/i386/pr100637-1b.C   |   4 +-
 gcc/testsuite/g++.target/i386/pr100637-1w.C   |   4 +-
 gcc/testsuite/g++.target/i386/pr103861-1.C    |   4 +-
 .../g++.target/i386/sse4_1-pr100637-1b.C      |  17 +
 .../g++.target/i386/sse4_1-pr100637-1w.C      |  17 +
 .../g++.target/i386/sse4_1-pr103861-1.C       |  17 +
 gcc/testsuite/gcc.target/i386/avx2-pr115517.c |  33 +
 .../gcc.target/i386/avx512-pr115517.c         |  70 ++
 gcc/testsuite/gcc.target/i386/pr103941-2.c    |   2 +-
 gcc/testsuite/gcc.target/i386/pr111023-2.c    |   4 +-
 gcc/testsuite/gcc.target/i386/pr88540.c       |   4 +-
 .../gcc.target/i386/sse4_1-pr88540.c          |  10 +
 gcc/testsuite/gcc.target/i386/vect-div-1.c    |   3 +-
 17 files changed, 918 insertions(+), 322 deletions(-)
 create mode 100644 gcc/testsuite/g++.target/i386/avx2-pr115517.C
 create mode 100644 gcc/testsuite/g++.target/i386/avx512-pr115517.C
 create mode 100644 gcc/testsuite/g++.target/i386/sse4_1-pr100637-1b.C
 create mode 100644 gcc/testsuite/g++.target/i386/sse4_1-pr100637-1w.C
 create mode 100644 gcc/testsuite/g++.target/i386/sse4_1-pr103861-1.C
 create mode 100644 gcc/testsuite/gcc.target/i386/avx2-pr115517.c
 create mode 100644 gcc/testsuite/gcc.target/i386/avx512-pr115517.c
 create mode 100644 gcc/testsuite/gcc.target/i386/sse4_1-pr88540.c

-- 
2.31.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-06-27 10:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-27  8:23 [PATCH 0/7][x86] Remove vcond{,u,eq}<mode> expanders liuhongt
2024-06-27  8:23 ` [PATCH 1/7] [x86] Add more splitters to match (unspec [op1 op2 (gt op3 constm1_operand)] UNSPEC_BLENDV) liuhongt
2024-06-27  8:23 ` [PATCH 2/7] Lower AVX512 kmask comparison back to AVX2 comparison when op_{true,false} is vector -1/0 liuhongt
2024-06-27 10:10   ` [PATCH 2/7] Lower AVX512 kmask comparison back to AVX2 comparison when op_{true, false} " Richard Biener
2024-06-27  8:23 ` [PATCH 3/7] [x86] Match IEEE min/max with UNSPEC_IEEE_{MIN,MAX} liuhongt
2024-06-27  8:23 ` [PATCH 4/7] Add more splitter for mskmov with avx512 comparison liuhongt
2024-06-27  8:23 ` [PATCH 5/7] Adjust testcase for the regressed testcases after obsolete of vcond{,u,eq} liuhongt
2024-06-27 10:17   ` [PATCH 5/7] Adjust testcase for the regressed testcases after obsolete of vcond{, u, eq} Richard Biener
2024-06-27  8:23 ` [PATCH 6/7] [x86] Optimize a < 0 ? -1 : 0 to (signed)a >> 31 liuhongt
2024-06-27  8:23 ` [PATCH 7/7] Remove vcond{,u,eq}<mode> expanders since they will be obsolete liuhongt
2024-06-27  9:59 ` [PATCH 0/7][x86] Remove vcond{,u,eq}<mode> expanders Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).