<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hello Reid,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for reporting it. I filed a bug to fix that (<a href="http://llvm.org/PR42560">http://llvm.org/PR42560</a>). However, I'm not sure I'll have time this week to look at it, especially given that we have no Windows builder around here. If you are critically
blocked by this, could you check that adding '// UNSUPPORTED: system-windows' properly disables the test? And if so, feel free to commit for now.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Marco</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Reid Kleckner <rnk@google.com><br>
<b>Sent:</b> 09 July 2019 21:47<br>
<b>To:</b> Marco Antognini<br>
<b>Cc:</b> cfe-commits<br>
<b>Subject:</b> Re: r365499 - [OpenCL][Sema] Fix builtin rewriting</font>
<div> </div>
</div>
<div>
<div dir="ltr">FYI, your test seems to fail on Windows:<br>
<div>FAIL: Clang :: CodeGenOpenCL/<a href="http://pipe_builtin.cl">pipe_builtin.cl</a> (4679 of 15176)<br>
******************** TEST 'Clang :: CodeGenOpenCL/<a href="http://pipe_builtin.cl">pipe_builtin.cl</a>' FAILED ********************<br>
Script:<br>
--<br>
: 'RUN: at line 1'; c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\9.0.0\include -nostdsysteminc -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=c++
-o - C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\CodeGenOpenCL\<a href="http://pipe_builtin.cl">pipe_builtin.cl</a> | c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\filecheck.exe C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\CodeGenOpenCL\<a href="http://pipe_builtin.cl">pipe_builtin.cl</a><br>
--<br>
Exit Code: 2<br>
<br>
Command Output (stdout):<br>
--<br>
$ ":" "RUN: at line 1"<br>
$ "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe" "-cc1" "-internal-isystem" "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\9.0.0\include" "-nostdsysteminc" "-emit-llvm" "-cl-ext=+cl_khr_subgroups" "-O0" "-cl-std=c++" "-o"
"-" "C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\CodeGenOpenCL\<a href="http://pipe_builtin.cl">pipe_builtin.cl</a>"<br>
# command stderr:<br>
C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\CodeGenOpenCL\pipe_builtin.cl:9:1: error: cannot mangle this OpenCL pipe type yet<br>
<br>
void test1(read_only pipe int p, global int *ptr) {<br>
<br>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
<br>
1 error generated.<br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Tue, Jul 9, 2019 at 8:04 AM Marco Antognini via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
Author: mantognini<br>
Date: Tue Jul 9 08:04:23 2019<br>
New Revision: 365499<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=365499&view=rev" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=365499&view=rev</a><br>
Log:<br>
[OpenCL][Sema] Fix builtin rewriting<br>
<br>
This patch ensures built-in functions are rewritten using the proper<br>
parent declaration.<br>
<br>
Existing tests are modified to run in C++ mode to ensure the<br>
functionality works also with C++ for OpenCL while not increasing the<br>
testing runtime.<br>
<br>
Modified:<br>
cfe/trunk/include/clang/Basic/Builtins.def<br>
cfe/trunk/lib/Sema/SemaExpr.cpp<br>
cfe/trunk/test/CodeGenOpenCL/<a href="http://builtins.cl" rel="noreferrer" target="_blank">builtins.cl</a><br>
cfe/trunk/test/CodeGenOpenCL/<a href="http://pipe_builtin.cl" rel="noreferrer" target="_blank">pipe_builtin.cl</a><br>
cfe/trunk/test/CodeGenOpenCL/<a href="http://to_addr_builtin.cl" rel="noreferrer" target="_blank">to_addr_builtin.cl</a><br>
<br>
Modified: cfe/trunk/include/clang/Basic/Builtins.def<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.def?rev=365499&r1=365498&r2=365499&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.def?rev=365499&r1=365498&r2=365499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Basic/Builtins.def (original)<br>
+++ cfe/trunk/include/clang/Basic/Builtins.def Tue Jul 9 08:04:23 2019<br>
@@ -1478,6 +1478,7 @@ BUILTIN(__builtin_coro_begin, "v*v*", "n<br>
BUILTIN(__builtin_coro_end, "bv*Ib", "n")<br>
BUILTIN(__builtin_coro_suspend, "cIb", "n")<br>
BUILTIN(__builtin_coro_param, "bv*v*", "n")<br>
+<br>
// OpenCL v2.0 s6.13.16, s9.17.3.5 - Pipe functions.<br>
// We need the generic prototype, since the packet type could be anything.<br>
LANGBUILTIN(read_pipe, "i.", "tn", OCLC20_LANG)<br>
@@ -1513,6 +1514,8 @@ LANGBUILTIN(get_kernel_max_sub_group_siz<br>
LANGBUILTIN(get_kernel_sub_group_count_for_ndrange, "Ui.", "tn", OCLC20_LANG)<br>
<br>
// OpenCL v2.0 s6.13.9 - Address space qualifier functions.<br>
+// FIXME: Pointer parameters of OpenCL builtins should have their address space<br>
+// requirement defined.<br>
LANGBUILTIN(to_global, "v*v*", "tn", OCLC20_LANG)<br>
LANGBUILTIN(to_local, "v*v*", "tn", OCLC20_LANG)<br>
LANGBUILTIN(to_private, "v*v*", "tn", OCLC20_LANG)<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=365499&r1=365498&r2=365499&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=365499&r1=365498&r2=365499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Jul 9 08:04:23 2019<br>
@@ -5360,7 +5360,7 @@ static bool checkArgsForPlaceholders(Sem<br>
/// FunctionDecl is returned.<br>
/// TODO: Handle pointer return types.<br>
static FunctionDecl *rewriteBuiltinFunctionDecl(Sema *Sema, ASTContext &Context,<br>
- const FunctionDecl *FDecl,<br>
+ FunctionDecl *FDecl,<br>
MultiExprArg ArgExprs) {<br>
<br>
QualType DeclType = FDecl->getType();<br>
@@ -5408,7 +5408,7 @@ static FunctionDecl *rewriteBuiltinFunct<br>
FunctionProtoType::ExtProtoInfo EPI;<br>
QualType OverloadTy = Context.getFunctionType(FT->getReturnType(),<br>
OverloadParams, EPI);<br>
- DeclContext *Parent = Context.getTranslationUnitDecl();<br>
+ DeclContext *Parent = FDecl->getParent();<br>
FunctionDecl *OverloadDecl = FunctionDecl::Create(Context, Parent,<br>
FDecl->getLocation(),<br>
FDecl->getLocation(),<br>
<br>
Modified: cfe/trunk/test/CodeGenOpenCL/<a href="http://builtins.cl" rel="noreferrer" target="_blank">builtins.cl</a><br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/builtins.cl?rev=365499&r1=365498&r2=365499&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/builtins.cl?rev=365499&r1=365498&r2=365499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenOpenCL/<a href="http://builtins.cl" rel="noreferrer" target="_blank">builtins.cl</a> (original)<br>
+++ cfe/trunk/test/CodeGenOpenCL/<a href="http://builtins.cl" rel="noreferrer" target="_blank">builtins.cl</a> Tue Jul 9 08:04:23 2019<br>
@@ -1,4 +1,4 @@<br>
-// RUN: %clang_cc1 %s -finclude-default-header -cl-std=CL2.0 -O0 -emit-llvm -o - -triple "spir-unknown-unknown" | FileCheck %s<br>
+// RUN: %clang_cc1 %s -finclude-default-header -cl-std=c++ -fblocks -O0 -emit-llvm -o - -triple "spir-unknown-unknown" | FileCheck %s<br>
<br>
void testBranchingOnEnqueueKernel(queue_t default_queue, unsigned flags, ndrange_t ndrange) {<br>
// Ensure `enqueue_kernel` can be branched upon.<br>
<br>
Modified: cfe/trunk/test/CodeGenOpenCL/<a href="http://pipe_builtin.cl" rel="noreferrer" target="_blank">pipe_builtin.cl</a><br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/pipe_builtin.cl?rev=365499&r1=365498&r2=365499&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/pipe_builtin.cl?rev=365499&r1=365498&r2=365499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenOpenCL/<a href="http://pipe_builtin.cl" rel="noreferrer" target="_blank">pipe_builtin.cl</a> (original)<br>
+++ cfe/trunk/test/CodeGenOpenCL/<a href="http://pipe_builtin.cl" rel="noreferrer" target="_blank">pipe_builtin.cl</a> Tue Jul 9 08:04:23 2019<br>
@@ -1,4 +1,4 @@<br>
-// RUN: %clang_cc1 -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=CL2.0 -o - %s | FileCheck %s<br>
+// RUN: %clang_cc1 -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=c++ -o - %s | FileCheck %s<br>
<br>
// CHECK-DAG: %opencl.pipe_ro_t = type opaque<br>
// CHECK-DAG: %opencl.pipe_wo_t = type opaque<br>
<br>
Modified: cfe/trunk/test/CodeGenOpenCL/<a href="http://to_addr_builtin.cl" rel="noreferrer" target="_blank">to_addr_builtin.cl</a><br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/to_addr_builtin.cl?rev=365499&r1=365498&r2=365499&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/to_addr_builtin.cl?rev=365499&r1=365498&r2=365499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenOpenCL/<a href="http://to_addr_builtin.cl" rel="noreferrer" target="_blank">to_addr_builtin.cl</a> (original)<br>
+++ cfe/trunk/test/CodeGenOpenCL/<a href="http://to_addr_builtin.cl" rel="noreferrer" target="_blank">to_addr_builtin.cl</a> Tue Jul 9 08:04:23 2019<br>
@@ -1,4 +1,4 @@<br>
-// RUN: %clang_cc1 -triple spir-unknown-unknown -emit-llvm -O0 -cl-std=CL2.0 -o - %s | FileCheck %s<br>
+// RUN: %clang_cc1 -triple spir-unknown-unknown -emit-llvm -O0 -cl-std=c++ -o - %s | FileCheck %s<br>
<br>
// CHECK: %[[A:.*]] = type { float, float, float }<br>
typedef struct {<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote>
</div>
</div>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose,
or store or copy the information in any medium. Thank you.
</body>
</html>