From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 26C9B3858CDB; Wed, 25 Oct 2023 17:05:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26C9B3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698253547; bh=zop5RoCP3SabAousaVNQmbHcCvSof3JJW/9iUhjJfG4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=umi2QBHsOpzwWRGA3y5S0bgljrF5WeYl7i3nayH/2V7eJ0seATTJWUego+9IAHiE9 kvT1I7q4FJDlzxtrFr5LyGdJasQToeJPROeQeQD/OGOx+4xFEykcVrfsm2Z5tHJL8M 9sOJ3od8S5cMs8Vq7tgkpww9sJpWBriK/uTuGz/8= From: "tnfchris at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/90608] Inline non-scalar minloc/maxloc calls Date: Wed, 25 Oct 2023 17:05:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 9.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: 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=3D90608 --- Comment #15 from Tamar Christina --- (In reply to Mikael Morin from comment #14) > Created attachment 56313 [details] > inline minloc with mask >=20 > This patch adds support for {min,max}loc with mask. Awesome, thank you! > It is not 100% testsuite clean as there are (runtime) error messages that > regress slightly for maxloc_bounds_{4,5,6,7}.f90 >=20 >=20 > (In reply to Mikael Morin from comment #11) > >=20 > > > The problem could be with the initialization of loop iteration variab= les. > > > (...) > > > Unfortunately, this conditional initialization seems to > > > confuse the optimizers a lot. > > >=20 > > On closer look, the conditional initialization doesn't seem to be that > > confusing (at least in the problematic case), as it's removed early (cc= p1) > > in the pipeline. The loop iteration variables remain initialized with = phis, > > but that's because of the loops. >=20 > Unfortunately, this is true for rank 1 arrays, but not for higher ranks. > Constant values are slowly propagated to the phi arguments as optimization > passes are run, but no simplification of the control flow happens as soon= as > multiple loop levels are involved. >=20 > Need to look into the dim argument next. It's very much appreciated! this should help greatly! Sorry I hadn't reply = to the previous message. Finishing up some work for stage-1.=