From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 661B73858D34; Mon, 20 Jul 2020 03:38:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 661B73858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1595216329; bh=iIoPmDueDm2+QR5DeRT358s/yCWmFWzVqFIEVQI2FQU=; h=From:To:Subject:Date:From; b=KXKMzwWox2NvIAL83BYGDP+ABg9iPeXMSBkyQGjf0wSJKMdvTdBXRF3Aw1KfVzO85 f3oct5SQ0DL8on5nQwMo9SUhqmRzAaatc6Ik/Zx9So3gFc6UEai2YiHwwZK0Ix9yig qRe50oywtpDMGC9phO8+SPbiGdeQWTQiGXnlCr7M= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/96244] New: Redudant mask load generated Date: Mon, 20 Jul 2020 03:38:49 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2020 03:38:49 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96244 Bug ID: 96244 Summary: Redudant mask load generated Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: crazylht at gmail dot com Target Milestone: --- cat test.c --- typedef int v8si __attribute__ ((__vector_size__ (32))); v8si foo (v8si a, v8si b, v8si c, v8si d) { v8si e; for (int i =3D 0; i !=3D 8; i++) e[i] =3D a[i] > b[i] ? c[i] : d[i]; return e; } --- gcc -Ofast -mavx2 test.c cat test.c.238t.optimized --- foo (v8si a, v8si b, v8si c, v8si d) { vector(8) int vect_iftmp.19; vector(8) int vect_iftmp.18; vector(8) mask__31.15; vector(8) int vect_iftmp.14; vector(8) mask__28.11; [local count: 119292720]: mask__28.11_40 =3D b_50(D) < a_53(D); vect_iftmp.14_43 =3D .MASK_LOAD (&c, 32B, mask__28.11_40); ---> redundant mask__31.15_44 =3D b_50(D) >=3D a_53(D); vect_iftmp.18_47 =3D .MASK_LOAD (&d, 32B, mask__31.15_44); ---> redundant vect_iftmp.19_49 =3D .VCOND (b_50(D), a_53(D), vect_iftmp.18_47, vect_iftmp.14_43, 110); return vect_iftmp.19_49; --- could be optimized to=20 --- vect_iftmp.19_49 =3D .VCOND (b_50(D), a_53(D), d, c); ---=