aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-03-08 10:20:12 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-03-08 10:20:12 +0000
commit94ec37a909697bbf29db73278c77621ccdf60693 (patch)
treeb688ace11870b78027045997e18c5e38315eddb7 /gcc
parent5d1504d42af6b12efeb83a2056424ceb1512961f (diff)
downloadgcc-94ec37a909697bbf29db73278c77621ccdf60693.zip
gcc-94ec37a909697bbf29db73278c77621ccdf60693.tar.gz
gcc-94ec37a909697bbf29db73278c77621ccdf60693.tar.bz2
re PR target/89578 (5% runtime regression for 481.wrf at -Ofast -flto)
2019-03-08 Richard Biener <rguenther@suse.de> PR middle-end/89578 * cfgloop.h (struct loop): Add owned_clique field. * cfgloopmanip.c (copy_loop_info): Copy it. * tree-cfg.c (gimple_duplicate_bb): Do not remap owned_clique cliques. * tree-inline.c (copy_loops): Remap owned_clique. * lto-streamer-in.c (input_cfg): Stream owned_clique. * lto-streamer-out.c (output_cfg): Likewise. From-SVN: r269484
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/cfgloop.h4
-rw-r--r--gcc/cfgloopmanip.c1
-rw-r--r--gcc/lto-streamer-in.c1
-rw-r--r--gcc/lto-streamer-out.c1
-rw-r--r--gcc/tree-cfg.c3
-rw-r--r--gcc/tree-inline.c5
7 files changed, 25 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 72a1c3f..b46c5af 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2019-03-08 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/89578
+ * cfgloop.h (struct loop): Add owned_clique field.
+ * cfgloopmanip.c (copy_loop_info): Copy it.
+ * tree-cfg.c (gimple_duplicate_bb): Do not remap owned_clique
+ cliques.
+ * tree-inline.c (copy_loops): Remap owned_clique.
+ * lto-streamer-in.c (input_cfg): Stream owned_clique.
+ * lto-streamer-out.c (output_cfg): Likewise.
+
2019-03-08 Jakub Jelinek <jakub@redhat.com>
PR target/80190
diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h
index 2e93af3..e82cd7a 100644
--- a/gcc/cfgloop.h
+++ b/gcc/cfgloop.h
@@ -227,6 +227,10 @@ struct GTY ((chain_next ("%h.next"))) loop {
Other values means unroll with the given unrolling factor. */
unsigned short unroll;
+ /* If this loop was inlined the main clique of the callee which does
+ not need remapping when copying the loop body. */
+ unsigned short owned_clique;
+
/* For SIMD loops, this is a unique identifier of the loop, referenced
by IFN_GOMP_SIMD_VF, IFN_GOMP_SIMD_LANE and IFN_GOMP_SIMD_LAST_LANE
builtins. */
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index 7eb587a..bfee48e 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -1024,6 +1024,7 @@ copy_loop_info (struct loop *loop, struct loop *target)
target->force_vectorize = loop->force_vectorize;
target->in_oacc_kernels_region = loop->in_oacc_kernels_region;
target->unroll = loop->unroll;
+ target->owned_clique = loop->owned_clique;
}
/* Copies copy of LOOP as subloop of TARGET loop, placing newly
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index 6d78e66..7727b9b 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -826,6 +826,7 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in,
/* Read OMP SIMD related info. */
loop->safelen = streamer_read_hwi (ib);
loop->unroll = streamer_read_hwi (ib);
+ loop->owned_clique = streamer_read_hwi (ib);
loop->dont_vectorize = streamer_read_hwi (ib);
loop->force_vectorize = streamer_read_hwi (ib);
loop->simduid = stream_read_tree (ib, data_in);
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index a72016a..b6e395b 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -1938,6 +1938,7 @@ output_cfg (struct output_block *ob, struct function *fn)
/* Write OMP SIMD related info. */
streamer_write_hwi (ob, loop->safelen);
streamer_write_hwi (ob, loop->unroll);
+ streamer_write_hwi (ob, loop->owned_clique);
streamer_write_hwi (ob, loop->dont_vectorize);
streamer_write_hwi (ob, loop->force_vectorize);
stream_write_tree (ob, loop->simduid, true);
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 088fc7b..f433efc 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -6244,7 +6244,8 @@ gimple_duplicate_bb (basic_block bb, copy_bb_data *id)
op = TREE_OPERAND (op, 0);
if ((TREE_CODE (op) == MEM_REF
|| TREE_CODE (op) == TARGET_MEM_REF)
- && MR_DEPENDENCE_CLIQUE (op) > 1)
+ && MR_DEPENDENCE_CLIQUE (op) > 1
+ && MR_DEPENDENCE_CLIQUE (op) != bb->loop_father->owned_clique)
{
if (!id->dependence_map)
id->dependence_map = new hash_map<dependence_hash,
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index d3e53d2..956e39f 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -2670,6 +2670,11 @@ copy_loops (copy_body_data *id,
cfun->has_unroll = true;
if (dest_loop->force_vectorize)
cfun->has_force_vectorize_loops = true;
+ if (id->src_cfun->last_clique != 0)
+ dest_loop->owned_clique
+ = remap_dependence_clique (id,
+ src_loop->owned_clique
+ ? src_loop->owned_clique : 1);
/* Finally place it into the loop array and the loop tree. */
place_new_loop (cfun, dest_loop);