From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AF12D385DC39; Sun, 14 Feb 2021 22:47:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF12D385DC39 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/98265] [10/11 Regression] gcc-10 has significantly worse code generated with -O2 compared to -O1 (or gcc-9 -O2) when using the Eigen C++ library Date: Sun, 14 Feb 2021 22:47:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 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 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: Sun, 14 Feb 2021 22:47:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98265 --- Comment #5 from Jan Hubicka --- We do not inline CwiseNullaryOp because it uses comdat local symbols. This is because we do split the function and the .part stays local. At least we should recompute if function calls comdat local after comdat lo= cal function is inlined. IPA function summary for Eigen::Matrix should_inline(float, fl= oat, float, float)/2 inlinable fp_expression global time: 36.000000 self size: 21 global size: 29 min size: 24 self stack: 16 global stack: 20 size:19.000000, time:18.500000 size:4.500000, time:3.500000, executed if:(not inlined) calls: operator*.isra/90 inlined freq:1.00 Stack frame offset 16, callee self size 4 Eigen::CwiseNullaryOp< , >::CwiseNullaryOp(long int, long int, Eigen::scalar_constant_op) [wi= th =3D Eigen::scalar_constant_op; PlainObjectT= ype =3D Eigen::Matrix]/20 callee refers to comdat-local symbo= ls freq:1.00 loop depth: 0 size: 5 time: 14 callee size: 6 stack: 0 op0 is compile time invariant op0 points to local or readonly memory op1 is compile time invariant op2 is compile time invariant op2 points to local or readonly memory=