From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 364EE385E020; Wed, 25 Nov 2020 12:59:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 364EE385E020 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/97984] [10/11 Regression] Worse code for -O3 than -O2 on aarch64 vector multiply-add Date: Wed, 25 Nov 2020 12:59:39 +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: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: 10.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: version everconfirmed cf_reconfirmed_on target_milestone bug_status 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: Wed, 25 Nov 2020 12:59:39 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97984 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unknown |11.0 Ever confirmed|0 |1 Last reconfirmed| |2020-11-25 Target Milestone|--- |10.3 Status|UNCONFIRMED |NEW --- Comment #1 from Richard Biener --- We vectorize the add but not the multiplication. FMA discovery comes after vectorization so it can't inhibit the transform (and vectorizer costing can= not factor that in). Is there vector madd available? arm vectorizer costing could honor the fact that there's ldp/stp instructio= ns and thus not artifically make a vector load cheaper than two adjacent scalar loads. That would only make the costings equal though. 0x3151930 *b_11(D) 1 times unaligned_load (misalign -1) costs 1 in body 0x3151930 _2 + _3 1 times vector_stmt costs 1 in body 0x3151930 1 times vec_construct costs 2 in prologue 0x3151930 _7 1 times unaligned_store (misalign -1) costs 1 in body 0x31569d0 _7 1 times scalar_store costs 1 in body 0x31569d0 _8 1 times scalar_store costs 1 in body 0x31569d0 _2 + _3 1 times scalar_stmt costs 1 in body 0x31569d0 _5 + _6 1 times scalar_stmt costs 1 in body 0x31569d0 *b_11(D) 1 times scalar_load costs 1 in body 0x31569d0 MEM[(long int *)b_11(D) + 8B] 1 times scalar_load costs 1 in body t.c:5:8: note: Cost model analysis: Vector inside of basic block cost: 3 Vector prologue cost: 2 Vector epilogue cost: 0 Scalar cost of basic block: 6 t.c:5:8: note: Basic block will be vectorized using SLP=