public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Cesar Philippidis <cesar@codesourcery.com>
To: Tom de Vries <Tom_deVries@mentor.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH,PTX] Add support for CUDA 9
Date: Wed, 17 Jan 2018 17:31:00 -0000	[thread overview]
Message-ID: <e462a180-6c9d-29f7-779b-8852100cdfe3@codesourcery.com> (raw)
In-Reply-To: <3693480e-a616-2233-2542-0403afbab7fa@mentor.com>

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

On 12/27/2017 01:16 AM, Tom de Vries wrote:
> On 12/21/2017 06:19 PM, Cesar Philippidis wrote:
>> My test results are somewhat inconsistent. On MG's build servers, there
>> are no regressions in CUDA 8. 
> 
> Ack.
> 
>> On my laptop, there are fewer regressions
>> in CUDA 9, than CUDA 8.
> 
> If the patch causes regressions for either cuda 8 or cuda 9, then they
> need to be analyzed and fixed.
> 
> Please clarify what you think it means if in one case there are less
> regressions than in the other.
> 
>> However, I think some of those failures are due
>> to premature timeouts on my laptop (I'm setting dejagnu to timeout after
>> 90s instead of 5m locally).
> 
> If you have flawed test results due to a local change you made, you need
> to undo the local change and rerun the test, and report the sane test
> results instead of reporting flawed test results.
> 
>> I know your on vacation, so I'll commit this patch to og7. We can
>> revisit the patch for trunk and other backports later.
> 
> If you don't have time to do the testing now, then please file a PR for
> this issue and attach the patch with the updates that address my comments.

Sorry for taking so long to respond. I finally had a chance to analyze
the results. There are no regressions with this patch. In fact, using
the unpatched CUDA8 build as a baseline, after the CUDA9 patch, 66
additional tests pass in CUDA 8 and 73 tests additional tests pass in
CUDA 9.

Is this patch OK for trunk?

Cesar

[-- Attachment #2: og7-ptx-cuda9.diff --]
[-- Type: text/x-patch, Size: 1358 bytes --]

2017-12-19  Cesar Philippidis  <cesar@codesourcery.com>

	gcc/
	* config/nvptx/nvptx.c (output_init_frag): Don't use generic address
	spaces for function labels.

	gcc/testsuite/
	* gcc.target/nvptx/indirect_call.c: New test.


diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index dfb27ef..a7b4c09 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -1894,9 +1894,15 @@ output_init_frag (rtx sym)
   
   if (sym)
     {
-      fprintf (asm_out_file, "generic(");
+      bool function = SYMBOL_REF_DECL (sym)
+	&& (TREE_CODE (SYMBOL_REF_DECL (sym)) == FUNCTION_DECL);
+      if (!function)
+	fprintf (asm_out_file, "generic(");
       output_address (VOIDmode, sym);
-      fprintf (asm_out_file, val ? ") + " : ")");
+      if (!function)
+	fprintf (asm_out_file, val ? ") + " : ")");
+      else if (val)
+	fprintf (asm_out_file, " + ");
     }
 
   if (!sym || val)
diff --git a/gcc/testsuite/gcc.target/nvptx/indirect_call.c b/gcc/testsuite/gcc.target/nvptx/indirect_call.c
new file mode 100644
index 0000000..39992a7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/indirect_call.c
@@ -0,0 +1,19 @@
+/* { dg-options "-O2 -msoft-stack" } */
+/* { dg-do run } */
+
+int
+f1 (int a)
+{
+  return a + 1;
+}
+  
+int (*f2)(int) = f1;
+
+int
+main ()
+{
+  if (f2 (100) != 101)
+    __builtin_abort();
+
+  return 0;
+}

  reply	other threads:[~2018-01-17 17:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19 23:25 Cesar Philippidis
2017-12-20  0:40 ` Tom de Vries
2017-12-20 22:59   ` Cesar Philippidis
2017-12-20 23:15     ` Tom de Vries
2017-12-21 17:19       ` Cesar Philippidis
2017-12-27  9:16         ` Tom de Vries
2018-01-17 17:31           ` Cesar Philippidis [this message]
2018-01-17 23:23             ` Tom de Vries
2018-01-19  4:27   ` Cesar Philippidis
2018-01-19  8:46     ` Tom de Vries
2018-02-27 14:08       ` Thomas Schwinge
2018-02-27 14:12         ` Richard Biener
2018-03-02  8:45           ` Thomas Schwinge

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=e462a180-6c9d-29f7-779b-8852100cdfe3@codesourcery.com \
    --to=cesar@codesourcery.com \
    --cc=Tom_deVries@mentor.com \
    --cc=gcc-patches@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).