From 2045ae1d3f511717c2a1223148ce63f71800e1dd Mon Sep 17 00:00:00 2001 From: Andrew Stubbs Date: Thu, 11 Oct 2018 14:00:20 +0000 Subject: 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 Jan Hubicka Martin Jambor 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 Co-Authored-By: Martin Jambor From-SVN: r265042 --- gcc/rtl-tests.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'gcc/rtl-tests.c') 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::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::run (); + test_dumping_repeat (); /* Purge state. */ set_first_insn (NULL); -- cgit v1.1