public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Haochen Jiang <haochen.jiang@intel.com>
Cc: gcc-patches@gcc.gnu.org, hongtao.liu@intel.com,
	Richard.Earnshaw@foss.arm.com, segher@kernel.crashing.org
Subject: Re: [PATCH] Support Intel prefetchit0/t1
Date: Tue, 8 Nov 2022 11:06:06 +0100	[thread overview]
Message-ID: <Y2oqDhtIpzKB/XZE@tucnak> (raw)
In-Reply-To: <20221104074632.19951-1-haochen.jiang@intel.com>

On Fri, Nov 04, 2022 at 03:46:32PM +0800, Haochen Jiang via Gcc-patches wrote:
> We will take back the patches which add a new parameter on original
> builtin_prefetch and implement instruction prefetch on that.
> 
> Also we consider that since we will only do that on specific backend,
> no need to add a new rtl for that.
> 
> This patch will only support instructions prefetch for x86 backend.
> 
> Regtested on x86_64-pc-linux-gnu. Ok for trunk?

The gcc.target/i386/prefetchi-4.c testcase ICEs for me on i686-linux.
Can be reproduced even on x86_64, with:
./cc1 -quiet -m32 -march=pentiumpro prefetchi-4.c -isystem include/
during RTL pass: expand
prefetchi-4.c: In function ‘prefetch_test’:
prefetchi-4.c:11:3: internal compiler error: in gen_prefetch, at config/i386/i386.md:23913
   11 |   __builtin_ia32_prefetch (p, 0, 3, 0);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x1b92416 gen_prefetch(rtx_def*, rtx_def*, rtx_def*)
	../../gcc/config/i386/i386.md:23913
0x141dcf3 ix86_expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
	../../gcc/config/i386/i386-expand.cc:13077
0x60deb4 expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
	../../gcc/builtins.cc:7321
0x80803d expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool)
	../../gcc/expr.cc:11865
0x7fa4d5 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool)
	../../gcc/expr.cc:9000
0x648c12 expand_expr
	../../gcc/expr.h:310
0x651c17 expand_call_stmt
	../../gcc/cfgexpand.cc:2831
0x655709 expand_gimple_stmt_1
	../../gcc/cfgexpand.cc:3880
0x655d93 expand_gimple_stmt
	../../gcc/cfgexpand.cc:4044
0x65e061 expand_gimple_basic_block
	../../gcc/cfgexpand.cc:6096
0x660575 execute
	../../gcc/cfgexpand.cc:6822
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

The ICE is on
          gcc_assert (TARGET_3DNOW);
          operands[2] = GEN_INT (3);
The expander has
  "TARGET_3DNOW || TARGET_PREFETCH_SSE || TARGET_PRFCHW || TARGET_PREFETCHWT1"
condition and for write handles all those different ISAs, so gcc_assert (TARGET_3DNOW);
at the end only asserts the obvious that the expander condition had to be
satisfied.  But for !write, it only has:
      if (TARGET_PREFETCH_SSE)
        ;
      else
        {
          gcc_assert (TARGET_3DNOW);
          operands[2] = GEN_INT (3);
        }
and here I don't understand how it can work, because if
!TARGET_3DNOW && !TARGET_PREFETCH_SSE, but
TARGET_PRFCHW || TARGET_PREFETCHWT1
then it clearly ICEs.  Both of the latter ISAs can be enabled/disabled
individually without dependencies.

It is unclear what exactly changed though, because the prefetch pattern
has not changed, but it didn't ICE before that commit.

	Jakub


  parent reply	other threads:[~2022-11-08 10:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04  7:46 Haochen Jiang
2022-11-07  1:28 ` Hongtao Liu
2022-11-08 10:06 ` Jakub Jelinek [this message]
2022-11-09  2:30   ` Hongtao Liu
2022-11-09  7:13   ` [PATCH] i386: Add ISA check for newly introduced prefetch builtins Haochen Jiang
2022-11-11  1:52     ` Hongtao Liu

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=Y2oqDhtIpzKB/XZE@tucnak \
    --to=jakub@redhat.com \
    --cc=Richard.Earnshaw@foss.arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=haochen.jiang@intel.com \
    --cc=hongtao.liu@intel.com \
    --cc=segher@kernel.crashing.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).