From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1210A398600A; Fri, 11 Sep 2020 10:29:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1210A398600A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1599820161; bh=jZ5sgq6ItjSNog7lUBuRX7ThJW1OqgC5BBucqNDWemA=; h=From:To:Subject:Date:From; b=yKhDANMixM9UlehuGq7HGHmdxm3zLXseIM3XdB84lqfH43FrXsGO+ea9WBe/LlFRM PalJDJYZd0VikXLxTrRwYMDIkOOR6ZZpBO6XXr3lFY6y/HeRThoGnyUPXRxdCz8j1A L2EYgW2Xm/gCjhr3P3oh1QVfeY/RcnqWW1hu+7G0= From: "linkw at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/97019] New: rs6000:redundant rldicr fed to lvx/stvx Date: Fri, 11 Sep 2020 10:29:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: linkw 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 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: Fri, 11 Sep 2020 10:29:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97019 Bug ID: 97019 Summary: rs6000:redundant rldicr fed to lvx/stvx Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: linkw at gcc dot gnu.org Target Milestone: --- When we do the early expansion for altivec built-in function vec_ld/vec_st,= we can probably leave some redundant rldicr x,y,0,59 which aims to AND (-16) f= or the vector access address, since the lvx/stvx will do the aligned and with = -16 themselves, they are useless. =3D=3D=3D=3D=3D test case =3D=3D=3D=3D extern int a, b, c; extern vector unsigned long long ev5, ev6, ev7, ev8; int test(unsigned char *pe) { vector unsigned long long v1, v2, v3, v4, v9; vector unsigned long long v5 =3D ev5; vector unsigned long long v6 =3D ev6; vector unsigned long long v7 =3D ev7; vector unsigned long long v8 =3D ev8; unsigned char *e =3D pe; do { if (a) { asm("memory"); v1 =3D __builtin_vec_ld(16, (unsigned long long *)e); v2 =3D __builtin_vec_ld(32, (unsigned long long *)e); v3 =3D __builtin_vec_ld(48, (unsigned long long *)e); e =3D e + 8; for (int i =3D 0; i < a; i++) { v4 =3D v5; v5 =3D __builtin_crypto_vpmsumd(v1, v6); v6 =3D __builtin_crypto_vpmsumd(v2, v7); v7 =3D __builtin_crypto_vpmsumd(v3, v8); e =3D e + 8; } } v5 =3D __builtin_vec_ld(16, (unsigned long long *)e); v6 =3D __builtin_vec_ld(32, (unsigned long long *)e); v7 =3D __builtin_vec_ld(48, (unsigned long long *)e); if (c) b =3D 1; } while (b); v9 =3D v4; int p =3D __builtin_unpack_vector_int128((vector __int128_t)v9, 0); return p; } =3D=3D=3D=3D command =3D=3D=3D=3D -m64 -O2 -mcpu=3Dpower8 Currently the function find_alignment_op in RTL swaps pass cares the case w= here have one single AND operation definition, we can extend it to check all definitions are AND operations and aligned with -16B.=