public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/107344] New: GCC/nvptx SESE region optimization
@ 2022-10-21  9:24 tschwinge at gcc dot gnu.org
  2022-10-21  9:29 ` [Bug target/107344] " cvs-commit at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2022-10-21  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107344
           Summary: GCC/nvptx SESE region optimization
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: openacc
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: vries at gcc dot gnu.org
  Target Milestone: ---
            Target: nvptx

GCC/nvptx has a "SESE region optimization",
<https://inbox.sourceware.org/gcc-patches/564CC75D.3020309@acm.org>.

A "regression" has been introduced by recent commit
r13-3217-gc4d15dddf6b9eacb36f535807ad2ee364af46e04 "[PR107195] Set range to
zero when nonzero mask is 0":

    UNSUPPORTED: libgomp.oacc-c/../libgomp.oacc-c-c++-common/nvptx-sese-1.c
-DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  -O0 
    PASS: libgomp.oacc-c/../libgomp.oacc-c-c++-common/nvptx-sese-1.c
-DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  -O2  (test
for excess errors)
    PASS: libgomp.oacc-c/../libgomp.oacc-c-c++-common/nvptx-sese-1.c
-DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  -O2 
execution test
    [-PASS:-]{+FAIL:+}
libgomp.oacc-c/../libgomp.oacc-c-c++-common/nvptx-sese-1.c
-DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  -O2  
scan-nvptx-none-offload-rtl-dump mach "SESE regions:.*
[0-9]+{[0-9]+->[0-9]+(\\.[0-9]+)+}"

Same for C++.

During investigation of that issue (which I suppose is just one random
example), I found that earlier code transformations/optimizations may inhibit
this "Neuter whole SESE regions" optimization.

It's unclear to me if this is an actual "problem", which optimization is "more
important".

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

* [Bug target/107344] GCC/nvptx SESE region optimization
  2022-10-21  9:24 [Bug target/107344] New: GCC/nvptx SESE region optimization tschwinge at gcc dot gnu.org
@ 2022-10-21  9:29 ` cvs-commit at gcc dot gnu.org
  2022-10-21  9:34 ` tschwinge at gcc dot gnu.org
  2022-10-21 11:17 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-21  9:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Thomas Schwinge <tschwinge@gcc.gnu.org>:

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

commit r13-3434-ga9de836c2b22f878cff592b96e11c1b95d4d36ee
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Sun Oct 16 00:07:20 2022 +0200

    Restore 'libgomp.oacc-c-c++-common/nvptx-sese-1.c' SESE regions checking
[PR107195, PR107344]

    That is, adjust for optimization introduced with recent
    commit r13-3217-gc4d15dddf6b9eacb36f535807ad2ee364af46e04
    "[PR107195] Set range to zero when nonzero mask is 0", where GCC now
    understands that after 'r *= 2;', 'r & 1' will never hold here, and thus
    transforms/optimizes/"disturbs" the original code such that GCC/nvptx's
later
    "Neuter whole SESE regions" optimization no longer is applicable to it:

        UNSUPPORTED: libgomp.oacc-c/../libgomp.oacc-c-c++-common/nvptx-sese-1.c
-DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  -O0
        PASS: libgomp.oacc-c/../libgomp.oacc-c-c++-common/nvptx-sese-1.c
-DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  -O2  (test
for excess errors)
        PASS: libgomp.oacc-c/../libgomp.oacc-c-c++-common/nvptx-sese-1.c
-DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  -O2 
execution test
        [-PASS:-]{+FAIL:+}
libgomp.oacc-c/../libgomp.oacc-c-c++-common/nvptx-sese-1.c
-DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  -O2  
scan-nvptx-none-offload-rtl-dump mach "SESE regions:.*
[0-9]+{[0-9]+->[0-9]+(\\.[0-9]+)+}"

    Same for C++.

    It's unclear to me if this is an actual "problem", which optimization is
"more
    important", so I've filed PR107344 "GCC/nvptx SESE region optimization" to
    capture this question, and here restore what we intend to be testing (to my
    understanding) in 'libgomp.oacc-c-c++-common/nvptx-sese-1.c'.

            PR tree-optimization/107195
            PR target/107344
            libgomp/
            * testsuite/libgomp.oacc-c-c++-common/nvptx-sese-1.c: Restore SESE
            regions checking.

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

* [Bug target/107344] GCC/nvptx SESE region optimization
  2022-10-21  9:24 [Bug target/107344] New: GCC/nvptx SESE region optimization tschwinge at gcc dot gnu.org
  2022-10-21  9:29 ` [Bug target/107344] " cvs-commit at gcc dot gnu.org
@ 2022-10-21  9:34 ` tschwinge at gcc dot gnu.org
  2022-10-21 11:17 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2022-10-21  9:34 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-10-21
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
Regression 'libgomp.oacc-c-c++-common/nvptx-sese-1.c' addressed, but this
remains to be looked into:

(In reply to Thomas Schwinge from comment #0)
> GCC/nvptx has a "SESE region optimization", <https://inbox.sourceware.org/gcc-patches/564CC75D.3020309@acm.org>.
> 
> [...]
> 
> During investigation of that issue (which I suppose is just one random example), I found that earlier code transformations/optimizations may inhibit this "Neuter whole SESE regions" optimization.
> 
> It's unclear to me if this is an actual "problem", which optimization is "more important".

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

* [Bug target/107344] GCC/nvptx SESE region optimization
  2022-10-21  9:24 [Bug target/107344] New: GCC/nvptx SESE region optimization tschwinge at gcc dot gnu.org
  2022-10-21  9:29 ` [Bug target/107344] " cvs-commit at gcc dot gnu.org
  2022-10-21  9:34 ` tschwinge at gcc dot gnu.org
@ 2022-10-21 11:17 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-10-21 11:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
I guess the reorg pass has to be simply enhanced to deal with "distorted"
regions, or alternatively those regions need to be protected somehow.

I'm just guessing that jump threading messes things up here?

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

end of thread, other threads:[~2022-10-21 11:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21  9:24 [Bug target/107344] New: GCC/nvptx SESE region optimization tschwinge at gcc dot gnu.org
2022-10-21  9:29 ` [Bug target/107344] " cvs-commit at gcc dot gnu.org
2022-10-21  9:34 ` tschwinge at gcc dot gnu.org
2022-10-21 11:17 ` rguenth at gcc dot gnu.org

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