public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/111889] New: [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute
@ 2023-10-20  6:40 haochen.jiang at intel dot com
  2023-10-20  6:41 ` [Bug target/111889] " haochen.jiang at intel dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: haochen.jiang at intel dot com @ 2023-10-20  6:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111889
           Summary: [14 Regression] 128/256 intrins could not be used with
                    only specifying "no-evex512, avx512vl" in function
                    attribute
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haochen.jiang at intel dot com
  Target Milestone: ---

Created attachment 56155
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56155&action=edit
Simple testcase

With this simple testcase and command like this:

x86_64-pc-linux-gnu-gcc -O2 -march=x86-64 1.c

We will finally get:

error: inlining failed in call to ‘always_inline’ ‘_mm256_mask_mov_pd’: target
specific option mismatch

But if we use the command like this:

x86_64-pc-linux-gnu-gcc -O2 -march=x86-64 -mno-evex512 1.c

It seems that the default handle for evex512 with avx512 will finally let the
compiler wrongly suppose that 128/256 bit intrins need evex512 feature when
co-operating with function attribute, but actually it does not.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/111889] [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute
  2023-10-20  6:40 [Bug target/111889] New: [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute haochen.jiang at intel dot com
@ 2023-10-20  6:41 ` haochen.jiang at intel dot com
  2023-10-20  6:43 ` haochen.jiang at intel dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: haochen.jiang at intel dot com @ 2023-10-20  6:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Haochen Jiang <haochen.jiang at intel dot com> ---
(In reply to Haochen Jiang from comment #0)
> Created attachment 56155 [details]
> Simple testcase
> 
> With this simple testcase and command like this:
> 
> x86_64-pc-linux-gnu-gcc -O2 -march=x86-64 1.c
> 
> We will finally get:
> 
> error: inlining failed in call to ‘always_inline’ ‘_mm256_mask_mov_pd’:
> target specific option mismatch
> 
> But if we use the command like this:
> 
> x86_64-pc-linux-gnu-gcc -O2 -march=x86-64 -mno-evex512 1.c

Oops, I missing a sentence here, I mean it will meet no issue if we specified
-mno-evex512 in command line.

> 
> It seems that the default handle for evex512 with avx512 will finally let
> the compiler wrongly suppose that 128/256 bit intrins need evex512 feature
> when co-operating with function attribute, but actually it does not.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/111889] [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute
  2023-10-20  6:40 [Bug target/111889] New: [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute haochen.jiang at intel dot com
  2023-10-20  6:41 ` [Bug target/111889] " haochen.jiang at intel dot com
@ 2023-10-20  6:43 ` haochen.jiang at intel dot com
  2023-10-20  6:49 ` haochen.jiang at intel dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: haochen.jiang at intel dot com @ 2023-10-20  6:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Haochen Jiang <haochen.jiang at intel dot com> ---
Here is the Godbolt example of that:

https://godbolt.org/z/b3n8h4rb1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/111889] [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute
  2023-10-20  6:40 [Bug target/111889] New: [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute haochen.jiang at intel dot com
  2023-10-20  6:41 ` [Bug target/111889] " haochen.jiang at intel dot com
  2023-10-20  6:43 ` haochen.jiang at intel dot com
@ 2023-10-20  6:49 ` haochen.jiang at intel dot com
  2023-10-20  6:51 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: haochen.jiang at intel dot com @ 2023-10-20  6:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Haochen Jiang <haochen.jiang at intel dot com> ---
My proposal for this problem is to also push "no-evex512" when defining 128/256
intrins. But I am not sure if there will be some potential problems.

Currently working on an experiment on that.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/111889] [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute
  2023-10-20  6:40 [Bug target/111889] New: [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute haochen.jiang at intel dot com
                   ` (2 preceding siblings ...)
  2023-10-20  6:49 ` haochen.jiang at intel dot com
@ 2023-10-20  6:51 ` rguenth at gcc dot gnu.org
  2023-10-23  5:47 ` crazylht at gmail dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-10-20  6:51 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-*-*
   Target Milestone|---                         |14.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/111889] [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute
  2023-10-20  6:40 [Bug target/111889] New: [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute haochen.jiang at intel dot com
                   ` (3 preceding siblings ...)
  2023-10-20  6:51 ` rguenth at gcc dot gnu.org
@ 2023-10-23  5:47 ` crazylht at gmail dot com
  2023-10-23  8:59 ` haochen.jiang at intel dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: crazylht at gmail dot com @ 2023-10-23  5:47 UTC (permalink / raw)
  To: gcc-bugs

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

Hongtao.liu <crazylht at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |crazylht at gmail dot com

--- Comment #4 from Hongtao.liu <crazylht at gmail dot com> ---
Maybe we should disable "no-vex512" for target attribute, only support option
for them

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/111889] [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute
  2023-10-20  6:40 [Bug target/111889] New: [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute haochen.jiang at intel dot com
                   ` (4 preceding siblings ...)
  2023-10-23  5:47 ` crazylht at gmail dot com
@ 2023-10-23  8:59 ` haochen.jiang at intel dot com
  2023-11-06  1:39 ` cvs-commit at gcc dot gnu.org
  2023-11-06  6:19 ` haochen.jiang at intel dot com
  7 siblings, 0 replies; 9+ messages in thread
From: haochen.jiang at intel dot com @ 2023-10-23  8:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Haochen Jiang <haochen.jiang at intel dot com> ---
It is actually a legacy issue from this:

$ cat 2.c
#include <immintrin.h>


__attribute__ ((target ("no-avx2")))
void foo ()
{
    return _mm_empty ();
}

$ x86_64-pc-linux-gnu-gcc -O2 -mavx512f 2.c

It will also fail.

The main reason is caused by caller's target is higher than callee's.

Previously it will not cause problem since we consider it makes sense and
nobody will write code in such pattern.

But we will introduce avx10.x-256/512 options and function attributes in near
future, the problem might become visible.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/111889] [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute
  2023-10-20  6:40 [Bug target/111889] New: [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute haochen.jiang at intel dot com
                   ` (5 preceding siblings ...)
  2023-10-23  8:59 ` haochen.jiang at intel dot com
@ 2023-11-06  1:39 ` cvs-commit at gcc dot gnu.org
  2023-11-06  6:19 ` haochen.jiang at intel dot com
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-06  1:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Haochen Jiang <jianghc@gcc.gnu.org>:

https://gcc.gnu.org/g:fd5147177b9fa04943a3a55512b81f8f46ab4ac5

commit r14-5140-gfd5147177b9fa04943a3a55512b81f8f46ab4ac5
Author: Haochen Jiang <haochen.jiang@intel.com>
Date:   Mon Nov 6 09:38:31 2023 +0800

    Push no-evex512 target for 128/256 bit intrins

    gcc/ChangeLog:

            PR target/111889
            * config/i386/avx512bf16intrin.h: Push no-evex512 target.
            * config/i386/avx512bf16vlintrin.h: Ditto.
            * config/i386/avx512bitalgvlintrin.h: Ditto.
            * config/i386/avx512bwintrin.h: Ditto.
            * config/i386/avx512dqintrin.h: Ditto.
            * config/i386/avx512fintrin.h: Ditto.
            * config/i386/avx512fp16intrin.h: Ditto.
            * config/i386/avx512fp16vlintrin.h: Ditto.
            * config/i386/avx512ifmavlintrin.h: Ditto.
            * config/i386/avx512vbmi2vlintrin.h: Ditto.
            * config/i386/avx512vbmivlintrin.h: Ditto.
            * config/i386/avx512vlbwintrin.h: Ditto.
            * config/i386/avx512vldqintrin.h: Ditto.
            * config/i386/avx512vlintrin.h: Ditto.
            * config/i386/avx512vnnivlintrin.h: Ditto.
            * config/i386/avx512vp2intersectvlintrin.h: Ditto.
            * config/i386/avx512vpopcntdqvlintrin.h: Ditto.

    gcc/testsuite/ChangeLog:

            PR target/111889
            * gcc.target/i386/pr111889.c: New test.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/111889] [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute
  2023-10-20  6:40 [Bug target/111889] New: [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute haochen.jiang at intel dot com
                   ` (6 preceding siblings ...)
  2023-11-06  1:39 ` cvs-commit at gcc dot gnu.org
@ 2023-11-06  6:19 ` haochen.jiang at intel dot com
  7 siblings, 0 replies; 9+ messages in thread
From: haochen.jiang at intel dot com @ 2023-11-06  6:19 UTC (permalink / raw)
  To: gcc-bugs

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

Haochen Jiang <haochen.jiang at intel dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Haochen Jiang <haochen.jiang at intel dot com> ---
Should be fixed after patches

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-11-06  6:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-20  6:40 [Bug target/111889] New: [14 Regression] 128/256 intrins could not be used with only specifying "no-evex512, avx512vl" in function attribute haochen.jiang at intel dot com
2023-10-20  6:41 ` [Bug target/111889] " haochen.jiang at intel dot com
2023-10-20  6:43 ` haochen.jiang at intel dot com
2023-10-20  6:49 ` haochen.jiang at intel dot com
2023-10-20  6:51 ` rguenth at gcc dot gnu.org
2023-10-23  5:47 ` crazylht at gmail dot com
2023-10-23  8:59 ` haochen.jiang at intel dot com
2023-11-06  1:39 ` cvs-commit at gcc dot gnu.org
2023-11-06  6:19 ` haochen.jiang at intel dot com

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).