Compiling our gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c with -Os -ftree-slp-vectorize -mavx512vl (or -Oz, for that matter) leads to an ICE: /tmp$ ~/gcc/small/inst/bin/gcc -Os -ftree-slp-vectorize -mavx512vl ~/gcc/small/src/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c -S during GIMPLE pass: slp /home/mjambor/gcc/small/src/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c: In function ‘foo1’: /home/mjambor/gcc/small/src/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c:15:1: internal compiler error: in ix86_widen_mult_cost, at config/i386/i386.cc:20442 15 | foo1(int len) { | ^~~~ 0x82f95a ix86_widen_mult_cost /home/mjambor/gcc/small/src/gcc/config/i386/i386.cc:20442 0x82f95a ix86_vector_costs::add_stmt_cost(int, vect_cost_for_stmt, _stmt_vec_info*, _slp_tree*, tree_node*, int, vect_cost_model_location) /home/mjambor/gcc/small/src/gcc/config/i386/i386.cc:23479 0x11fe9b2 add_stmt_cost(vector_costs*, int, vect_cost_for_stmt, _stmt_vec_info*, _slp_tree*, tree_node*, int, vect_cost_model_location) /home/mjambor/gcc/small/src/gcc/tree-vectorizer.h:1779 0x11fe9b2 add_stmt_cost(vector_costs*, stmt_info_for_cost*) /home/mjambor/gcc/small/src/gcc/tree-vectorizer.h:1801 0x11fe9b2 vect_bb_vectorization_profitable_p /home/mjambor/gcc/small/src/gcc/tree-vect-slp.cc:6928 0x1202f3e vect_slp_region /home/mjambor/gcc/small/src/gcc/tree-vect-slp.cc:7441 0x1203eec vect_slp_bbs /home/mjambor/gcc/small/src/gcc/tree-vect-slp.cc:7611 0x12041cc vect_slp_function(function*) /home/mjambor/gcc/small/src/gcc/tree-vect-slp.cc:7712 0x120e3d1 execute /home/mjambor/gcc/small/src/gcc/tree-vectorizer.cc:1529 I have bisected this to r14-666-g608e7f3ab47fe7: commit 608e7f3ab47fe746279c552c3574147aa3d8ee76 (HEAD) Author: Uros Bizjak <ubizjak@gmail.com> Date: Wed May 10 22:40:53 2023 +0200 i386: Add missing vector extend patterns [PR92658] Add missing insn pattern for v2qi -> v2si vector extend and named expanders to activate generation of vector extends to 8-byte and 4-byte vectors. gcc/ChangeLog: PR target/92658 * config/i386/mmx.md (sse4_1_<code>v2qiv2si2): New insn pattern. (<insn>v4qiv4hi2): New expander. (<insn>v2hiv2si2): Ditto. (<insn>v2qiv2si2): Ditto. (<insn>v2qiv2hi2): Ditto. gcc/testsuite/ChangeLog: PR target/92658 * gcc.target/i386/pr92658-sse4-4b.c: New test. * gcc.target/i386/pr92658-sse4-8b.c: New test.
I think this was just fixed?
(In reply to Richard Biener from comment #1) > I think this was just fixed? No, the asked mode is V2HImode, so it should also be added.
(In reply to Uroš Bizjak from comment #2) > (In reply to Richard Biener from comment #1) > > I think this was just fixed? > > No, the asked mode is V2HImode, so it should also be added. OTOH, it is a bit strange to report some fake cost for unsupported modes. Should we return an arbitrary high value for unsupported modes instead of just ICEing?
Like this: --cut here-- diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index 62fe06fdbaa..e6091b8bd35 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -20417,14 +20417,12 @@ ix86_widen_mult_cost (const struct processor_costs *cost, int basic_cost = 0; switch (mode) { - case V4HImode: case V8HImode: case V16HImode: if (!uns_p || mode == V16HImode) extra_cost = cost->sse_op * 2; basic_cost = cost->mulss * 2 + cost->sse_op * 4; break; - case V2SImode: case V4SImode: case V8SImode: /* pmulhw/pmullw can be used. */ @@ -20441,7 +20439,8 @@ ix86_widen_mult_cost (const struct processor_costs *cost, basic_cost = cost->mulss * 2 + cost->sse_op * 4; break; default: - gcc_unreachable(); + /* Not implemented. */ + return 1000; } return ix86_vec_cost (mode, basic_cost + extra_cost); } --cut here--
*** Bug 109838 has been marked as a duplicate of this bug. ***
.
*** Bug 109807 has been marked as a duplicate of this bug. ***
Dup. *** This bug has been marked as a duplicate of bug 109807 ***