diff options
author | Andrew Stubbs <ams@codesourcery.com> | 2018-10-11 14:00:20 +0000 |
---|---|---|
committer | Andrew Stubbs <ams@gcc.gnu.org> | 2018-10-11 14:00:20 +0000 |
commit | 2045ae1d3f511717c2a1223148ce63f71800e1dd (patch) | |
tree | dc74c7785ea195aa9f6861e525f4709cbc23d73e /gcc/rtl-tests.c | |
parent | f9f3b77cf5290a8417cfc450b936039c78f6618b (diff) | |
download | gcc-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/rtl-tests.c')
-rw-r--r-- | gcc/rtl-tests.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/rtl-tests.c b/gcc/rtl-tests.c index f67f2a3..c684f8e 100644 --- a/gcc/rtl-tests.c +++ b/gcc/rtl-tests.c @@ -284,6 +284,29 @@ const_poly_int_tests<N>::run () gen_int_mode (poly_int64 (5, -1), QImode)); } +/* Check dumping of repeated RTL vectors. */ + +static void +test_dumping_repeat () +{ + rtx p = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (3)); + XVECEXP (p, 0, 0) = const0_rtx; + XVECEXP (p, 0, 1) = const0_rtx; + XVECEXP (p, 0, 2) = const0_rtx; + ASSERT_RTL_DUMP_EQ ("(parallel [\n" + " (const_int 0) repeated x3\n" + " ])", + p); + + XVECEXP (p, 0, 1) = const1_rtx; + ASSERT_RTL_DUMP_EQ ("(parallel [\n" + " (const_int 0)\n" + " (const_int 1)\n" + " (const_int 0)\n" + " ])", + p); +} + /* Run all of the selftests within this file. */ void @@ -295,6 +318,7 @@ rtl_tests_c_tests () test_single_set (); test_uncond_jump (); const_poly_int_tests<NUM_POLY_INT_COEFFS>::run (); + test_dumping_repeat (); /* Purge state. */ set_first_insn (NULL); |