public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104879] New: [nvptx] Use .common directive (available starting ptx isa version 5.0)
@ 2022-03-11  9:34 vries at gcc dot gnu.org
  2022-03-14  3:08 ` [Bug target/104879] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: vries at gcc dot gnu.org @ 2022-03-11  9:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104879
           Summary: [nvptx] Use .common directive (available starting ptx
                    isa version 5.0)
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

We currently have in the nvptx port in nvptx_option_override:
...
  /* Set flag_no_common, unless explicitly disabled.  We fake common            
     using .weak, and that's not entirely accurate, so avoid it                 
     unless forced.  */
  if (!OPTION_SET_P (flag_no_common))
    flag_no_common = 1;
...
and in nvptx_output_aligned_decl:
...
  /* If this is public, it is common.  The nearest thing we have to             
     common is weak.  */
  fprintf (file, "\t%s", TREE_PUBLIC (decl) ? ".weak " : "");
...

[ There's also some optimisation note related to .common:
...
/* Buffer needed to broadcast across workers and vectors.  This is              
   used for both worker-neutering and worker broadcasting, and                  
   vector-neutering and boardcasting when vector_length > 32.  It is            
   shared by all functions emitted.  The buffer is placed in shared             
   memory.  It'd be nice if PTX supported common blocks, because then           
   this could be shared across TUs (taking the largest size).  */
...
but I'm not sure whether this is safe, perhaps this would require a mutex to
make it safe. ]

Starting with ptx isa 5.0, we have the .common directive available in ptx.

However, it "can be used only on variables with .global storage", so it's
somewhat limited.

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

* [Bug target/104879] [nvptx] Use .common directive (available starting ptx isa version 5.0)
  2022-03-11  9:34 [Bug target/104879] New: [nvptx] Use .common directive (available starting ptx isa version 5.0) vries at gcc dot gnu.org
@ 2022-03-14  3:08 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-03-14  3:08 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
flag_no_common is already set by default to true since r10-4867-g6271dd984d7f92
so this is even less important than before ...

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

end of thread, other threads:[~2022-03-14  3:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-11  9:34 [Bug target/104879] New: [nvptx] Use .common directive (available starting ptx isa version 5.0) vries at gcc dot gnu.org
2022-03-14  3:08 ` [Bug target/104879] " pinskia 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).