public inbox for gcc-regression@sourceware.org
help / color / mirror / Atom feed
* [TCWG CI] Regression caused by gcc: Loosen loop crossing restriction in threader.
@ 2021-10-06 0:11 ci_notify
0 siblings, 0 replies; only message in thread
From: ci_notify @ 2021-10-06 0:11 UTC (permalink / raw)
To: Aldy Hernandez; +Cc: gcc-regression
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 11520 bytes --]
[TCWG CI] Regression caused by gcc: Loosen loop crossing restriction in threader.:
commit ec0124e0acb556cdf5dba0e8d0ca6b69d9537fcc
Author: Aldy Hernandez <aldyh@redhat.com>
Loosen loop crossing restriction in threader.
Results regressed to
# reset_artifacts:
-10
# true:
0
# build_abe binutils:
1
# First few build errors in logs:
# 00:04:18 make[3]: [Makefile:1769: aarch64-unknown-linux-gnu/bits/largefile-config.h] Error 1 (ignored)
# 00:04:18 make[3]: [Makefile:1770: aarch64-unknown-linux-gnu/bits/largefile-config.h] Error 1 (ignored)
# 00:08:46 /home/tcwg-buildslave/workspace/tcwg_gnu_10/abe/snapshots/gcc.git~master/gcc/calls.c:206:26: error: âconst_upperâ may be used uninitialized in this function [-Werror=maybe-uninitialized]
# 00:08:54 make[3]: *** [Makefile:1136: calls.o] Error 1
# 00:16:46 make[2]: *** [Makefile:4817: all-stage2-gcc] Error 2
# 00:16:46 make[1]: *** [Makefile:24679: stage2-bubble] Error 2
# 00:16:46 make: *** [Makefile:1013: all] Error 2
from
# reset_artifacts:
-10
# true:
0
# build_abe binutils:
1
# build_abe bootstrap:
2
THIS IS THE END OF INTERESTING STUFF. BELOW ARE LINKS TO BUILDS, REPRODUCTION INSTRUCTIONS, AND THE RAW COMMIT.
This commit has regressed these CI configurations:
- tcwg_gcc_bootstrap/master-aarch64-bootstrap
First_bad build: https://ci.linaro.org/job/tcwg_gcc_bootstrap-bisect-master-aarch64-bootstrap/4/artifact/artifacts/build-ec0124e0acb556cdf5dba0e8d0ca6b69d9537fcc/
Last_good build: https://ci.linaro.org/job/tcwg_gcc_bootstrap-bisect-master-aarch64-bootstrap/4/artifact/artifacts/build-1f51e9af7b615838424214e6aaea0de793cb10fe/
Baseline build: https://ci.linaro.org/job/tcwg_gcc_bootstrap-bisect-master-aarch64-bootstrap/4/artifact/artifacts/build-baseline/
Even more details: https://ci.linaro.org/job/tcwg_gcc_bootstrap-bisect-master-aarch64-bootstrap/4/artifact/artifacts/
Reproduce builds:
<cut>
mkdir investigate-gcc-ec0124e0acb556cdf5dba0e8d0ca6b69d9537fcc
cd investigate-gcc-ec0124e0acb556cdf5dba0e8d0ca6b69d9537fcc
# Fetch scripts
git clone https://git.linaro.org/toolchain/jenkins-scripts
# Fetch manifests and test.sh script
mkdir -p artifacts/manifests
curl -o artifacts/manifests/build-baseline.sh https://ci.linaro.org/job/tcwg_gcc_bootstrap-bisect-master-aarch64-bootstrap/4/artifact/artifacts/manifests/build-baseline.sh --fail
curl -o artifacts/manifests/build-parameters.sh https://ci.linaro.org/job/tcwg_gcc_bootstrap-bisect-master-aarch64-bootstrap/4/artifact/artifacts/manifests/build-parameters.sh --fail
curl -o artifacts/test.sh https://ci.linaro.org/job/tcwg_gcc_bootstrap-bisect-master-aarch64-bootstrap/4/artifact/artifacts/test.sh --fail
chmod +x artifacts/test.sh
# Reproduce the baseline build (build all pre-requisites)
./jenkins-scripts/tcwg_gnu-build.sh @@ artifacts/manifests/build-baseline.sh
# Save baseline build state (which is then restored in artifacts/test.sh)
mkdir -p ./bisect
rsync -a --del --delete-excluded --exclude /bisect/ --exclude /artifacts/ --exclude /gcc/ ./ ./bisect/baseline/
cd gcc
# Reproduce first_bad build
git checkout --detach ec0124e0acb556cdf5dba0e8d0ca6b69d9537fcc
../artifacts/test.sh
# Reproduce last_good build
git checkout --detach 1f51e9af7b615838424214e6aaea0de793cb10fe
../artifacts/test.sh
cd ..
</cut>
Full commit (up to 1000 lines):
<cut>
commit ec0124e0acb556cdf5dba0e8d0ca6b69d9537fcc
Author: Aldy Hernandez <aldyh@redhat.com>
Date: Tue Oct 5 15:03:34 2021 +0200
Loosen loop crossing restriction in threader.
Crossing loops is generally discouraged from the threader, but we can
make an exception when we don't cross the latch or enter another loop,
since this is just an early exit out of the loop.
In fact, the whole threaded path is logically outside the loop. This
has nice secondary effects. For example, objects on the threaded path
will no longer necessarily be live throughout the loop, so we can get
register allocation improvements. The threaded path can physically
move outside the loop resulting in better icache efficiency, etc.
Tested on x86-64 Linux, and on a visium-elf cross making sure that the
following tests do not have an abort in the final assembly:
gcc.c-torture/execute/960218-1.c
gcc.c-torture/execute/visium-pending-4.c
gcc.c-torture/execute/pr58209.c
gcc/ChangeLog:
* tree-ssa-threadupdate.c (jt_path_registry::cancel_invalid_paths):
Loosen restrictions
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/ssa-thread-valid.c: New test.
---
gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-valid.c | 39 +++++++++++++++++++++++
gcc/tree-ssa-threadupdate.c | 40 +++++++++++++++++-------
2 files changed, 68 insertions(+), 11 deletions(-)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-valid.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-valid.c
new file mode 100644
index 00000000000..7adca97cc2b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-valid.c
@@ -0,0 +1,39 @@
+// { dg-do compile }
+// { dg-options "-O2 -fgimple -fdump-statistics" }
+
+// This is a collection of threadable paths. To simplify maintenance,
+// there should only be one threadable path per function.
+
+int global;
+
+// The thread from 3->4->5 crosses loops but is allowed because it
+// never crosses the latch (BB3) and is just an early exit out of the
+// loop.
+int __GIMPLE (ssa)
+foo1 (int x)
+{
+ int D_1420;
+ int a;
+
+ __BB(2):
+ a_4 = ~x_3(D);
+ goto __BB4;
+
+ // Latch.
+ __BB(3):
+ global = a_1;
+ goto __BB4;
+
+ __BB(4,loop_header(1)):
+ a_1 = __PHI (__BB2: a_4, __BB3: 0);
+ if (a_1 != 0)
+ goto __BB3;
+ else
+ goto __BB5;
+
+ __BB(5):
+ return;
+
+}
+
+// { dg-final { scan-tree-dump "Jumps threaded\" \"foo1\" 1" "statistics" } }
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index dcabfdb30d2..32ce1e3af40 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -2766,10 +2766,17 @@ bool
jt_path_registry::cancel_invalid_paths (vec<jump_thread_edge *> &path)
{
gcc_checking_assert (!path.is_empty ());
- edge taken_edge = path[path.length () - 1]->e;
- loop_p loop = taken_edge->src->loop_father;
+ edge entry = path[0]->e;
+ edge exit = path[path.length () - 1]->e;
bool seen_latch = false;
- bool path_crosses_loops = false;
+ int loops_crossed = 0;
+ bool crossed_latch = false;
+ // Use ->dest here instead of ->src to ignore the first block. The
+ // first block is allowed to be in a different loop, since it'll be
+ // redirected. See similar comment in profitable_path_p: "we don't
+ // care about that block...".
+ loop_p loop = entry->dest->loop_father;
+ loop_p curr_loop = loop;
for (unsigned int i = 0; i < path.length (); i++)
{
@@ -2784,19 +2791,30 @@ jt_path_registry::cancel_invalid_paths (vec<jump_thread_edge *> &path)
}
if (loop->latch == e->src || loop->latch == e->dest)
- seen_latch = true;
+ {
+ seen_latch = true;
+ // Like seen_latch, but excludes the first block.
+ if (e->src != entry->src)
+ crossed_latch = true;
+ }
- // The first entry represents the block with an outgoing edge
- // that we will redirect to the jump threading path. Thus we
- // don't care about that block's loop father.
- if ((i > 0 && e->src->loop_father != loop)
- || e->dest->loop_father != loop)
- path_crosses_loops = true;
+ if (e->dest->loop_father != curr_loop)
+ {
+ curr_loop = e->dest->loop_father;
+ ++loops_crossed;
+ }
if (flag_checking && !m_backedge_threads)
gcc_assert ((path[i]->e->flags & EDGE_DFS_BACK) == 0);
}
+ // If we crossed a loop into an outer loop without crossing the
+ // latch, this is just an early exit from the loop.
+ if (loops_crossed == 1
+ && !crossed_latch
+ && flow_loop_nested_p (exit->dest->loop_father, exit->src->loop_father))
+ return false;
+
if (cfun->curr_properties & PROP_loop_opts_done)
return false;
@@ -2806,7 +2824,7 @@ jt_path_registry::cancel_invalid_paths (vec<jump_thread_edge *> &path)
"would create non-empty latch");
return true;
}
- if (path_crosses_loops)
+ if (loops_crossed)
{
cancel_thread (&path, "Path crosses loops");
return true;
</cut>
>From hjl@sc.intel.com Wed Oct 6 08:40:49 2021
Return-Path: <hjl@sc.intel.com>
X-Original-To: gcc-regression@gcc.gnu.org
Delivered-To: gcc-regression@gcc.gnu.org
Received: from mga01.intel.com (mga01.intel.com [192.55.52.88])
by sourceware.org (Postfix) with ESMTPS id 2DD7F385802D
for <gcc-regression@gcc.gnu.org>; Wed, 6 Oct 2021 08:40:48 +0000 (GMT)
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2DD7F385802D
X-IronPort-AV: E=McAfee;i="6200,9189,10128"; a="249217431"
X-IronPort-AV: E=Sophos;i="5.85,350,1624345200"; d="scan'208";a="249217431"
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
06 Oct 2021 01:40:40 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.85,350,1624345200"; d="scan'208";a="545200637"
Received: from scymds01.sc.intel.com ([10.148.94.138])
by fmsmga004.fm.intel.com with ESMTP; 06 Oct 2021 01:40:40 -0700
Received: from gnu-ivb-1.sc.intel.com (gnu-ivb-1.sc.intel.com [172.25.70.227])
by scymds01.sc.intel.com with ESMTP id 1968eenf009611;
Wed, 6 Oct 2021 01:40:40 -0700
Received: by gnu-ivb-1.sc.intel.com (Postfix, from userid 1000)
id 783DA180B6E; Wed, 6 Oct 2021 01:40:40 -0700 (PDT)
Date: Wed, 06 Oct 2021 01:40:40 -0700
To: skpgkp2@gmail.com, hjl.tools@gmail.com, gcc-regression@gcc.gnu.org
Subject: Regressions on master at commit r12-4202 vs commit r12-4149 on
Linux/i686
User-Agent: Heirloom mailx 12.5 7/5/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: <20211006084040.783DA180B6E@gnu-ivb-1.sc.intel.com>
From: "H.J. Lu" <hjl@sc.intel.com>
X-Spam-Status: No, score=-3470.3 required=5.0 testsºYES_00, KAM_DMARC_STATUS,
KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,
SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
server2.sourceware.org
X-BeenThere: gcc-regression@gcc.gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Gcc-regression mailing list <gcc-regression.gcc.gnu.org>
List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-regression>,
<mailto:gcc-regression-request@gcc.gnu.org?subject=unsubscribe>
List-Archive: <https://gcc.gnu.org/pipermail/gcc-regression/>
List-Post: <mailto:gcc-regression@gcc.gnu.org>
List-Help: <mailto:gcc-regression-request@gcc.gnu.org?subject=help>
List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-regression>,
<mailto:gcc-regression-request@gcc.gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Oct 2021 08:40:49 -0000
New failures:
FAIL: g++.dg/modules/xtreme-header-4_b.C -std=c++2a (internal compiler error)
FAIL: g++.dg/modules/xtreme-header-4_b.C -std=c++2a (test for excess errors)
New passes:
FAIL: gfortran.dg/predict-2.f90 -O scan-tree-dump-times profile_estimate "Fortran loop preheader heuristics of edge" 2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-06 0:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-06 0:11 [TCWG CI] Regression caused by gcc: Loosen loop crossing restriction in threader ci_notify
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).