aboutsummaryrefslogtreecommitdiff
path: root/gcc/print-rtl.c
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@codesourcery.com>2018-10-11 14:00:20 +0000
committerAndrew Stubbs <ams@gcc.gnu.org>2018-10-11 14:00:20 +0000
commit2045ae1d3f511717c2a1223148ce63f71800e1dd (patch)
treedc74c7785ea195aa9f6861e525f4709cbc23d73e /gcc/print-rtl.c
parentf9f3b77cf5290a8417cfc450b936039c78f6618b (diff)
downloadgcc-2045ae1d3f511717c2a1223148ce63f71800e1dd.zip
gcc-2045ae1d3f511717c2a1223148ce63f71800e1dd.tar.gz
gcc-2045ae1d3f511717c2a1223148ce63f71800e1dd.tar.bz2
Elide repeated RTL elements.
GCN's 64-lane vectors tend to make RTL dumps very long. This patch makes them far more bearable by eliding long sequences of the same element into "repeated" messages. This also takes care of reading repeated sequences in the RTL front-end. There are self tests for both reading and writing. 2018-10-11 Andrew Stubbs <ams@codesourcery.com> Jan Hubicka <jh@suse.cz> Martin Jambor <mjambor@suse.cz> gcc/ * print-rtl.c (print_rtx_operand_codes_E_and_V): Print how many times the same elements are repeated rather than printing all of them. * read-rtl.c (rtx_reader::read_rtx_operand): Recognize and expand "repeated" elements. * read-rtl-function.c (test_loading_repeat): New function. (read_rtl_function_c_tests): Call test_loading_repeat. * rtl-tests.c (test_dumping_repeat): New function. (rtl_tests_c_tests): Call test_dumping_repeat. gcc/testsuite/ * selftests/repeat.rtl: New file. Co-Authored-By: Jan Hubicka <jh@suse.cz> Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r265042
Diffstat (limited to 'gcc/print-rtl.c')
-rw-r--r--gcc/print-rtl.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 233be9e..7af92e1 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -370,7 +370,20 @@ rtx_writer::print_rtx_operand_codes_E_and_V (const_rtx in_rtx, int idx)
m_sawclose = 1;
for (int j = 0; j < XVECLEN (in_rtx, idx); j++)
- print_rtx (XVECEXP (in_rtx, idx, j));
+ {
+ int j1;
+
+ print_rtx (XVECEXP (in_rtx, idx, j));
+ for (j1 = j + 1; j1 < XVECLEN (in_rtx, idx); j1++)
+ if (XVECEXP (in_rtx, idx, j) != XVECEXP (in_rtx, idx, j1))
+ break;
+
+ if (j1 != j + 1)
+ {
+ fprintf (m_outfile, " repeated x%i", j1 - j);
+ j = j1 - 1;
+ }
+ }
m_indent -= 2;
}