From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8BF143858C33; Wed, 19 Jul 2023 06:57:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BF143858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689749860; bh=JxQ+2DUA66YpOkUoMWv+aB5jXkRS2qeRbuKqIN1uNYg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=x9w55m30axoUQZE/YTJYlVEqVCzQquUUloI3V6SQAhk3qPFW9rhFhYItVj6nDh8tM TIasZwYo0oRcX2Xgk6hDLSZRidjwQOSDegPyet+iCtVKs6s5DLdxl3B+Twh645WMlm yRF0z5NiUahMWfofesbzayjbGFidIgYV48DAfDPY= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110711] possible missed optimization for std::max with -march=znver2 Date: Wed, 19 Jul 2023 06:57:39 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: missed-optimization, openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com X-Bugzilla-Status: NEW 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: Message-ID: In-Reply-To: References: 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=3D110711 --- Comment #4 from Hongtao.liu --- [local count: 105119324]: _6 =3D .LOOP_VECTORIZED (1, 2); if (_6 !=3D 0) goto ; [100.00%] else goto ; [100.00%] [local count: 105119324]: [local count: 955630227]: # i_21 =3D PHI # prephitmp_19 =3D PHI _2 =3D i_21 * 8; _3 =3D a_10(D) + _2; _17 =3D MEM[(const double &)_3]; _29 =3D MAX_EXPR <_17, prephitmp_19>; prephitmp_24 =3D _29; i_16 =3D i_21 + 1; if (n_els_7(D) > i_16) goto ; [89.00%] else goto ; [11.00%] [local count: 105119324]: # prephitmp_15 =3D PHI <_29(5), prephitmp_27(16)> goto ; [100.00%] [local count: 850510903]: goto ; [100.00%] test.C:8:26: note: Analyze phi: prephitmp_19 =3D PHI test.C:8:26: note: reduction path: prephitmp_24 _29 prephitmp_19=20 test.C:8:26: note: reduction: unknown pattern test.C:8:26: missed: Unknown def-use cycle pattern. test.C:8:26: note: =3D=3D=3D vect_determine_precisions =3D=3D=3D It looks like there's extra move generate by ifcvt which make vectorizer th= ink it's not a reduction. prephitmp_24 can be replaced with _29 since it's not = used elsewhere.=