aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorYunde Zhong <zhongyunde@huawei.com>2020-08-03 15:05:02 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2020-08-03 15:05:02 +0100
commitd1773f58f3a03e6c764373635fa079fa7526cfcf (patch)
tree5d1b1ca140623035346cc4bc0a356569629b74ec /gcc
parentb32c5d0b72fda2588b4e170e75a9c64e4bf266c7 (diff)
downloadgcc-d1773f58f3a03e6c764373635fa079fa7526cfcf.zip
gcc-d1773f58f3a03e6c764373635fa079fa7526cfcf.tar.gz
gcc-d1773f58f3a03e6c764373635fa079fa7526cfcf.tar.bz2
regrename: Avoid disrupting SMS schedule [PR95696]
SMS is performed before reload, and each insn in SMS schedule uses pseudo-register. After reload, regrename pass try to adjust the hard registers with def/use chain created by build_def_use. For now, regrename pass isn't aware of VLIW bundles created by SMS, it may updated a register which may not be really unused, which will causes invalid VLIW bundles. Before the final schedule, we recheck the validation of VLIW bundles and reschedule the conflicted insns to avoid the above issue. Rescheduling the conflicted insns will destroy SMS schedule of the kernel loop, which would be harmful to performance. 2020-08-03 Yunde Zhong <zhongyunde@huawei.com> gcc/ PR rtl-optimization/95696 * regrename.c (regrename_analyze): New param include_all_block_p with default value TRUE. If set to false, avoid disrupting SMS schedule. * regrename.h (regrename_analyze): Adjust prototype.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/regrename.c16
-rw-r--r--gcc/regrename.h2
2 files changed, 14 insertions, 4 deletions
diff --git a/gcc/regrename.c b/gcc/regrename.c
index 669a6ea..ebe74c5 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -695,10 +695,12 @@ merge_chains (du_head_p c1, du_head_p c2)
c1->cannot_rename |= c2->cannot_rename;
}
-/* Analyze the current function and build chains for renaming. */
+/* Analyze the current function and build chains for renaming.
+ If INCLUDE_ALL_BLOCKS_P is set to true, process all blocks,
+ ignoring BB_DISABLE_SCHEDULE. The default value is true. */
void
-regrename_analyze (bitmap bb_mask)
+regrename_analyze (bitmap bb_mask, bool include_all_block_p)
{
class bb_rename_info *rename_info;
int i;
@@ -748,6 +750,14 @@ regrename_analyze (bitmap bb_mask)
if (dump_file)
fprintf (dump_file, "\nprocessing block %d:\n", bb1->index);
+ if (!include_all_block_p && (bb1->flags & BB_DISABLE_SCHEDULE) != 0)
+ {
+ if (dump_file)
+ fprintf (dump_file, "avoid disrupting the sms schedule of bb %d\n",
+ bb1->index);
+ continue;
+ }
+
init_rename_info (this_info, bb1);
success = build_def_use (bb1);
@@ -1962,7 +1972,7 @@ regrename_optimize (void)
regrename_init (false);
- regrename_analyze (NULL);
+ regrename_analyze (NULL, false);
rename_chains ();
diff --git a/gcc/regrename.h b/gcc/regrename.h
index f2af04b..10a3aa1 100644
--- a/gcc/regrename.h
+++ b/gcc/regrename.h
@@ -100,7 +100,7 @@ extern vec<insn_rr_info> insn_rr;
extern void regrename_init (bool);
extern void regrename_finish (void);
-extern void regrename_analyze (bitmap);
+extern void regrename_analyze (bitmap, bool = true);
extern du_head_p regrename_chain_from_id (unsigned int);
extern int find_rename_reg (du_head_p, enum reg_class, HARD_REG_SET *, int,
bool);