From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D38C43858D32; Fri, 4 Aug 2023 22:26:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D38C43858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691187982; bh=ME0/bUCsQ+nDTWitxJv2aa2f2/g6KRT4/pGb+4R9Txc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=K6LsNPe+RoJCOSVaZ86wWZVtu0UD5jspc3GBLxgpj8wUQdCzD7C0sRq7Wi3vZuocx jQNr5McSOhiJkJTuxSychfEHaMB22ZLNRiPguMjdRmBMoD4QAMu8eNGRPJ0ML+upwD UMPjgWnml1RTTocniTR0ZqDv8hNQtZVVScgUpatg= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/96167] fails to detect ROL pattern in simple case, but succeeds when operand goes through memcpy Date: Fri, 04 Aug 2023 22:26:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org 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: cf_known_to_work cf_known_to_fail 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=3D96167 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Known to work| |12.1.0 Known to fail| |10.5.0 --- Comment #5 from Andrew Pinski --- For x86_64, this was fixed in GCC 11+ at -O3 and for GCC 12+ for -O2 by the vectorizer. But I think we could do better at the code generation at the gimple level. We have: vect__4.7_8 =3D MEM [(int &)x_1(D)]; vect_tmp_3.8_9 =3D VEC_PERM_EXPR ; MEM [(int &)x_1(D)] =3D vect_tmp_3.8_9; Which could just be: tmp =3D MEM[(int&)x_1(D)]; tmp =3D tmp ror 32; MEM[(int&)x_1(D)] =3D tmp;=