From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8F8DA3858D1E; Fri, 30 Sep 2022 11:41:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F8DA3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664538119; bh=lzokdRUGtUR9IJmXr80ixs3eumWU0umu6ZcrZWL5Avg=; h=From:To:Subject:Date:From; b=C5J+QWxluRLx34LPuAhmzgsmQNCrFIF5XNwwunCS5jyL3EXrBt96wdwaM+E1vGA+u lzTD66OY5XC4gvghGM9Lq1P0CsvUgJ/QRQxm0ui7HpLo6lJrteBh9lgnbj/PZmz9E0 30y5YaBn2xYG4Ji556KQOioJDPeuJl1PqYsh73pY= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107096] New: Fully masking vectorization with AVX512 ICEs gcc.dg/vect/vect-over-widen-*.c Date: Fri, 30 Sep 2022 11:41:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107096 Bug ID: 107096 Summary: Fully masking vectorization with AVX512 ICEs gcc.dg/vect/vect-over-widen-*.c Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- With like /home/rguenther/src/trunk/gcc/testsuite/gcc.dg/vect/vect-over-widen-2.c:11:= 1: error: conversion of register to a different size in 'view_convert_expr' VIEW_CONVERT_EXPR>(loop_mask_11); _164 =3D VIEW_CONVERT_EXPR>(loop_mask_11); /home/rguenther/src/trunk/gcc/testsuite/gcc.dg/vect/vect-over-widen-2.c:11:= 1: error: conversion of register to a different size in 'view_convert_expr' VIEW_CONVERT_EXPR>(loop_mask_8); _167 =3D VIEW_CONVERT_EXPR>(loop_mask_8); /home/rguenther/src/trunk/gcc/testsuite/gcc.dg/vect/vect-over-widen-2.c:11:= 1: error: conversion of register to a different size in 'view_convert_expr' VIEW_CONVERT_EXPR>(loop_mask_118); _170 =3D VIEW_CONVERT_EXPR>(loop_mask_118); /home/rguenther/src/trunk/gcc/testsuite/gcc.dg/vect/vect-over-widen-2.c:11:= 1: error: conversion of register to a different size in 'view_convert_expr' VIEW_CONVERT_EXPR>(loop_mask_119); _173 =3D VIEW_CONVERT_EXPR>(loop_mask_119); during GIMPLE pass: vect dump file: ./vect-over-widen-2.c.172t.vect /home/rguenther/src/trunk/gcc/testsuite/gcc.dg/vect/vect-over-widen-2.c:11:= 1: internal compiler error: verify_gimple failed The issue is that in vect_get_loop_mask we do if (maybe_ne (TYPE_VECTOR_SUBPARTS (mask_type), TYPE_VECTOR_SUBPARTS (vectype))) { /* A loop mask for data type X can be reused for data type Y if X has N times more elements than Y and if Y's elements are N times bigger than X's. In this case each sequence of N elements in the loop mask will be all-zero or all-one. We can then view-convert the mask so that each sequence of N elements is replaced by a single element. */ gcc_assert (multiple_p (TYPE_VECTOR_SUBPARTS (mask_type), TYPE_VECTOR_SUBPARTS (vectype))); gimple_seq seq =3D NULL; mask_type =3D truth_type_for (vectype); mask =3D gimple_build (&seq, VIEW_CONVERT_EXPR, mask_type, mask); but that ends up VIEW_CONVERTing vector(16) to vector(8) , in this case a HImode mask to a QImode mask. If I understand the comment correctly then it wants to re-use a mask for V16QI for V8HI indicating that the mask bits should be set in pairs for the V16QImask. But then I don't understand how VIEW_CONVERTing should perform the desired conversion. It might be OK if the mask is a byte mask (like for classic AVX2) but for AVX512 it would require unpacking even/odd bits. The actual error is likely in the setup of the loop masks though, thinking we could do this re-use.=