aboutsummaryrefslogtreecommitdiff
path: root/gcc/read-rtl-function.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/read-rtl-function.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/read-rtl-function.c')
-rw-r--r--gcc/read-rtl-function.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/read-rtl-function.c b/gcc/read-rtl-function.c
index cde9d3e..8746f70 100644
--- a/gcc/read-rtl-function.c
+++ b/gcc/read-rtl-function.c
@@ -2166,6 +2166,20 @@ test_loading_mem ()
ASSERT_EQ (6, MEM_ADDR_SPACE (mem2));
}
+/* Verify that "repeated xN" is read correctly. */
+
+static void
+test_loading_repeat ()
+{
+ rtl_dump_test t (SELFTEST_LOCATION, locate_file ("repeat.rtl"));
+
+ rtx_insn *insn_1 = get_insn_by_uid (1);
+ ASSERT_EQ (PARALLEL, GET_CODE (PATTERN (insn_1)));
+ ASSERT_EQ (64, XVECLEN (PATTERN (insn_1), 0));
+ for (int i = 0; i < 64; i++)
+ ASSERT_EQ (const0_rtx, XVECEXP (PATTERN (insn_1), 0, i));
+}
+
/* Run all of the selftests within this file. */
void
@@ -2187,6 +2201,7 @@ read_rtl_function_c_tests ()
test_loading_cfg ();
test_loading_bb_index ();
test_loading_mem ();
+ test_loading_repeat ();
}
} // namespace selftest