Fix ICE: Don't generate integer mask comparision for 128/256-bits vector when op_true...
authorliuhongt <hongtao.liu@intel.com>
Thu, 7 Jan 2021 02:15:33 +0000 (10:15 +0800)
committerliuhongt <hongtao.liu@intel.com>
Fri, 5 Feb 2021 01:59:36 +0000 (09:59 +0800)
commit8d0737d8f4b10bffe0411507ad2dc21ba7679883
treeb8310687e1fb97a2470128173382fc12e3a81b68
parentb80fefd626460fb8924248622ba59dd56246703e
Fix ICE: Don't generate integer mask comparision for 128/256-bits vector when op_true/op_false are NULL or constm1_rtx/const0_rtx [PR98537]

avx512vl-pr92686-vpcmp-{1,2,intelasm-1}.c are used to guard code
generation of integer mask comparison, but for vector comparison to
vector dest, integer mask comparison is disliked, so delete these
useless tests.

gcc/ChangeLog:

PR target/98537
* config/i386/i386-expand.c (ix86_expand_sse_cmp): Don't
generate integer mask comparison for 128/256-bits vector when
op_true/op_false is NULL_RTX or CONSTM1_RTX/CONST0_RTX. Also
delete redundant !maskcmp condition.
(ix86_expand_int_vec_cmp): Ditto but no redundant deletion
here.
(ix86_expand_sse_movcc): Delete definition of maskcmp, add the
condition directly to if (maskcmp), add extra check for
cmpmode, it should be MODE_INT.
(ix86_expand_fp_vec_cmp): Pass NULL to ix86_expand_sse_cmp's
parameters op_true/op_false.
(ix86_use_mask_cmp_p): New.

gcc/testsuite/ChangeLog:

PR target/98537
* g++.target/i386/avx512bw-pr98537-1.C: New test.
* g++.target/i386/avx512vl-pr98537-1.C: New test.
* g++.target/i386/avx512vl-pr98537-2.C: New test.
* gcc.target/i386/avx512vl-pr88547-1.c: Adjust testcase,
integer mask comparison should not be generated.
* gcc.target/i386/avx512vl-pr92686-vpcmp-1.c: Remove.
* gcc.target/i386/avx512vl-pr92686-vpcmp-2.c: Ditto.
* gcc.target/i386/avx512vl-pr92686-vpcmp-intelasm-1.c: Ditto.
gcc/config/i386/i386-expand.c
gcc/testsuite/g++.target/i386/avx512bw-pr98537-1.C [new file with mode: 0644]
gcc/testsuite/g++.target/i386/avx512vl-pr98537-1.C [new file with mode: 0644]
gcc/testsuite/g++.target/i386/avx512vl-pr98537-2.C [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512vl-pr88547-1.c
gcc/testsuite/gcc.target/i386/avx512vl-pr92686-vpcmp-1.c [deleted file]
gcc/testsuite/gcc.target/i386/avx512vl-pr92686-vpcmp-2.c [deleted file]
gcc/testsuite/gcc.target/i386/avx512vl-pr92686-vpcmp-intelasm-1.c [deleted file]