public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/101185] [12 Regression] pr96814.c failed after r12-1669 on non-avx512 platform
Date: Thu, 24 Jun 2021 07:08:09 +0000	[thread overview]
Message-ID: <bug-101185-4-kx4UGuZl55@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101185-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101185

--- Comment #6 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Richard Biener from comment #5)
> Of course I wonder why the RA even chooses registers that are not available
> on the architecture.  I suppose there's no real way to turn regs on/off but
> the way is to make them never match any instruction pattern and thus give RA
> no incentive to use them?  That is, why was kmovd  %edx,%k0 deemed a valid
> recognizable instruction?

RA is not problematic here, because registers are available due to -mavx512f.
The problem is that due to the register pressure around cpuid insn on 32bit
targets RA chooses to move the value to the mask register. cpuid and the logic
around is used to determine if avx512f is supported on the runtime target, and
mask instructions acting as logic instructions around cpuid causes SIGILL in
case avx512 is not supported during execution.

The solution to this is to allocate mask registers last and raise the cost of
moves from GPR to mask regs, so (similar to MMX) mask regs are only used when
absolutely necessary.

In the past, I have introduced separate instruction patterns, instanced
exclusively from builtins, but they didn't support generic logic operators,
e.g. "mask1 & mask2". To solve this, mask reg alternatives were added to
standard logic patterns, so there is now no clear cut between mask and GPR
alternatives.

  parent reply	other threads:[~2021-06-24  7:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24  1:32 [Bug target/101185] New: pr96814 " crazylht at gmail dot com
2021-06-24  1:44 ` [Bug target/101185] " crazylht at gmail dot com
2021-06-24  1:52 ` crazylht at gmail dot com
2021-06-24  1:56 ` [Bug target/101185] pr96814.c " crazylht at gmail dot com
2021-06-24  6:01 ` ubizjak at gmail dot com
2021-06-24  6:44 ` [Bug target/101185] [12 Regression] " rguenth at gcc dot gnu.org
2021-06-24  7:08 ` ubizjak at gmail dot com [this message]
2021-06-24  7:14 ` crazylht at gmail dot com
2021-06-24  8:41 ` jakub at gcc dot gnu.org
2021-06-24  8:52 ` crazylht at gmail dot com
2021-06-24  9:12 ` ubizjak at gmail dot com
2021-06-24  9:18 ` crazylht at gmail dot com
2021-06-24  9:36 ` rguenth at gcc dot gnu.org
2021-06-24 12:13 ` hjl.tools at gmail dot com
2021-06-25  1:17 ` cvs-commit at gcc dot gnu.org
2021-07-14 12:10 ` cvs-commit at gcc dot gnu.org
2021-09-20  4:33 ` [Bug testsuite/101185] " pinskia at gcc dot gnu.org
2021-09-20  4:43 ` pinskia at gcc dot gnu.org
2021-09-20  4:47 ` [Bug target/101185] " pinskia at gcc dot gnu.org
2021-09-20  6:19 ` rguenther at suse dot de
2022-01-05  6:00 ` crazylht at gmail dot com

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=bug-101185-4-kx4UGuZl55@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).