From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ADA073861881; Thu, 12 Aug 2021 08:01:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADA073861881 From: "tnfchris at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95962] Inefficient code for simple arm_neon.h iota operation Date: Thu, 12 Aug 2021 08:01:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: tnfchris 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_reconfirmed_on bug_status everconfirmed cc 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 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: Thu, 12 Aug 2021 08:01:49 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95962 Tamar Christina changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-08-12 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 CC| |tnfchris at gcc dot gnu.org --- Comment #1 from Tamar Christina --- We generate the correct code at -O3 but not -O2. At -O3 we generate foo: adrp x0, .LC0 sub sp, sp, #16 ldr q0, [x0, #:lo12:.LC0] add sp, sp, 16 ret where the problem seems to be at at -O2 store merging has broken up the construction of `array` into two separate memory accesses: MEM [(int *)&array] =3D 4294967296; MEM [(int *)&array + 8B] =3D 12884901890; whereas at -O3 we still have a single assignment: MEM [(int *)&array] =3D { 0, 1, 2, 3 }; I'm not sure even if we made these loads gimple level if that would help. w= e'd still have the explicit MEMs created by store merging. Perhaps we should just make store-merging allow TImode merges and split the= m in the backend if needed.=