From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C5ED83858C39; Thu, 29 Feb 2024 07:19:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5ED83858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709191175; bh=nch7G3F0TVhS7yJbY1On18Hl67qRVMBORsJGm/in6SQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UbNbjeBm1xuNbTHX7HR1vG4kQh2MLoei7WDZX/8JRPglSs21Uqt3Oe7RlilLl9K8O +/Gdp0mtKaRYh6eE+OFugPxC+09eHeIoyOMULWdBiJxVFAUZtW8PvIDEIj82p972xa nFXWW8mfhf4F6WDMzTsHmDzkUf/tIGVfoH/JZd4U= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114151] [14 Regression] weird and inefficient codegen and addressing modes since g:a0b1798042d033fd2cc2c806afbb77875dd2909b Date: Thu, 29 Feb 2024 07:19:35 +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: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de 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: 14.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114151 --- Comment #4 from rguenther at suse dot de --- On Wed, 28 Feb 2024, tnfchris at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114151 >=20 > --- Comment #3 from Tamar Christina --- > >=20 > > This was a correctness fix btw, so I'm not sure we can easily recover -= we > > could try using niter information for CHREC_VARIABLE but then there's > > variable niter here so I don't see a chance. > >=20 >=20 > It looks like it's mostly SVE suffering here. Adv. SIMD an scalar codegen= seems > to have vastly improved with it. we see ~10% improvements due to better > addressing for scalar. >=20 > It also only happens at -O3 but -O2 is fine, which is weird as I was expe= cted > IVopts to be enabled at -O2 too. Note the underlying issue, analyzing { a, +, b } * c differently and thus eventually dependent CHRECs failing to analyze should be independent on the architecture. What was definitely missing is consideration of POLY_INT_CSTs (and variable polys, as I think there's no range info for those). We do eventually want to improve how ranger behaves here. I'm not sure why when we do not provide a context 'stmt' it can't see to compute a range valid at the SSA names point of definition? (so basically compute the global range) Maybe there's another API to do that. But I thought it was convenient to use range_of_expr as that also handles GENERIC expression trees to some extent and those are common within SCEV.=