public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernd Schmidt <bschmidt@redhat.com>
To: David Malcolm <dmalcolm@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 0/9] RFC: selftests based on RTL dumps
Date: Mon, 12 Sep 2016 14:14:00 -0000	[thread overview]
Message-ID: <319e562e-7b25-9e9d-eced-1ea4b7c2f109@redhat.com> (raw)
In-Reply-To: <1473381053-18817-1-git-send-email-dmalcolm@redhat.com>

In general, it's functionality that I would very much like to have 
(although maybe it's less useful these days now that the rtl side is 
fairly static). I think there's not much sense looking too deeply at the 
individual patches yet; we need to first figure out what we would really 
like this to look like in the end.

> These tests are very target-specific and were developed mostly for
> target==x86_64, and a little for target==aarch64.
> I put clauses like this in the various test functions, which is a kludge:
>
>     /* Only run these tests for i386.  */
>  #ifndef I386_OPTS_H
>     return;
>  #endif
>
> Is there a better way to express this condition?  (I guess I could
> add a selftest::target_is_x86_p () predicate).

My preferred solution would still be a separate selftest backend, which 
could be built as a cross-compiler once in a separate top-level 
directory. That way we have control over it, and maintainers of actual 
targets don't need to fear breaking selftests when they make changes to 
their ports. The downside would primarily be the time to build it.

> +  const char *input_dump
> +    = ("(insn 8 0 9 2 (set (reg:DI 78)\n"
> +       "        (lshiftrt:DI (reg:DI 76)\n"
> +       "            (const_int 32 [0x20])))\n"
> +       "        ../../src/gcc/testsuite/gcc.dg/asr_div1.c:14\n"
> +       "        641 {*aarch64_lshr_sisd_or_int_di3}\n"
> +       "     (expr_list:REG_DEAD (reg:DI 76)\n"
> +       "        (nil)))\n"
> +       "(insn 9 8 0 2 (set (reg:SI 79)\n"
> +       "        (ashiftrt:SI (subreg:SI (reg:DI 78) 0)\n"
> +       "            (const_int 3 [0x3])))\n"
> +       "        ../../src/gcc/testsuite/gcc.dg/asr_div1.c:14\n"
> +       "        642 {*aarch64_ashr_sisd_or_int_si3}\n"
> +       "     (expr_list:REG_DEAD (reg:DI 78)\n"
> +       "        (nil)))\n");

I can sort of see the desire to just copy&paste dumps into this, but 
this strikes me as really ugly. Especially if we end up using real 
targets this hard-codes not just pattern structure but also pattern 
names, which I think is too great a burden on target maintainers.

It's also not unheard of for the insn structure to change a bit; I 
remember a change which swapped location and pattern (I think).

There's also a fairly large amount of visual clutter here, such as the 
input filenames.

Maybe there's room for a tool to take input dumps and convert them to 
something more readable, or maybe to a sequence of gen_/emit_ function 
calls?


Bernd

  parent reply	other threads:[~2016-09-12 14:10 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-09  0:01 David Malcolm
2016-09-09  0:01 ` [PATCH 4/9] Expose forcibly_ggc_collect and run it after all selftests David Malcolm
2016-09-16 20:30   ` Jeff Law
2016-09-09  0:01 ` [PATCH 9/9] cse.c selftests David Malcolm
2016-09-16 20:34   ` Jeff Law
2016-09-16 21:28     ` David Malcolm
2016-09-19 17:37       ` Jeff Law
2016-09-22  3:23         ` [PATCH] Introduce selftest::locate_file David Malcolm
2016-09-28 16:33           ` Jeff Law
2016-09-09  0:01 ` [PATCH 6/9] df selftests David Malcolm
2016-09-16 20:40   ` Jeff Law
2016-09-16 21:34     ` David Malcolm
2016-09-09  0:01 ` [PATCH 8/9] final.c selftests David Malcolm
2016-09-16 21:12   ` Jeff Law
2016-09-16 21:41     ` David Malcolm
2016-09-19 21:38       ` Jeff Law
2016-09-09  0:01 ` [PATCH 1/9] Introduce class rtx_reader David Malcolm
2016-09-16 22:15   ` Jeff Law
2016-09-21 17:22     ` [PATCH, v2] " David Malcolm
2016-09-21 20:44       ` Richard Sandiford
2016-09-09  0:01 ` [PATCH 2/9] Add selftest::read_file David Malcolm
2016-09-16 21:19   ` Jeff Law
2016-09-09  0:01 ` [PATCH 3/9] selftest.h: add temp_override fixture David Malcolm
2016-09-14 22:24   ` Trevor Saunders
2016-09-16 20:37   ` Jeff Law
2016-09-09  0:01 ` [PATCH 7/9] combine.c selftests David Malcolm
2016-09-16 20:45   ` Jeff Law
2016-09-16 21:39     ` David Malcolm
2016-09-09  0:13 ` [PATCH 5/9] Introduce class function_reader David Malcolm
2016-09-16 21:31   ` Jeff Law
2016-09-16 22:04     ` David Malcolm
2016-09-19 21:39       ` Jeff Law
2016-09-12 14:14 ` Bernd Schmidt [this message]
2016-09-12 18:59   ` [PATCH 0/9] RFC: selftests based on RTL dumps David Malcolm
2016-09-13 11:35     ` Bernd Schmidt
2016-09-14 10:33       ` Bernd Schmidt
2016-09-16 20:26       ` Jeff Law
2016-09-16 21:28         ` David Malcolm
2016-09-19 17:50           ` Jeff Law
2016-09-20 14:34             ` Register numbers in RTL dumps (was Re: [PATCH 0/9] RFC: selftests based on RTL dumps) David Malcolm
2016-09-20 14:38               ` Bernd Schmidt
2016-09-20 15:26                 ` Jeff Law
2016-09-20 15:38                   ` Bernd Schmidt
2016-09-20 19:35                   ` David Malcolm
2016-09-21 18:59                     ` [PATCH] print-rtx.c: add 'h', v' and 'p' prefixes to regnos David Malcolm
2016-09-28 16:30                       ` Jeff Law
2016-09-28 16:33                         ` Bernd Schmidt
2016-09-28 17:11                           ` Jeff Law
2016-09-28 17:19                             ` Bernd Schmidt
2016-09-29 13:00                               ` David Malcolm
2016-09-29 17:32                               ` Jeff Law
2016-09-13 20:39     ` [PATCH 0/9] RFC: selftests based on RTL dumps Jeff Law
2016-09-14  8:44       ` Richard Biener
2016-09-16 20:16         ` Jeff Law
2016-09-16 21:27           ` David Malcolm
2016-09-19 12:21             ` Bernd Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=319e562e-7b25-9e9d-eced-1ea4b7c2f109@redhat.com \
    --to=bschmidt@redhat.com \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).