[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Daniel Stone via cfe-commits

fooishbar wrote:

cc @karolherbst @airlied who are better contacts for CL in Mesa these days

https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-20 Thread Daniel Stone via cfe-commits


@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 
 if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
   set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
-  set( opt_flags )
+  set( clc_opt_flags )
+  # Inline CLC functions into OpenCL builtins
+  set( opencl_opt_flags "--passes=always-inline" )

fooishbar wrote:

This is delving back a little while, but certainly one thing we wanted to avoid 
was inlining. Partly because it generates massive piles of SPIR-V that we have 
to parse when everything in libclc gets inlined into everything else in libclc, 
but also partly because it removes our ability to use libclc only for some 
functionality and not for everything.

https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-19 Thread Daniel Stone via cfe-commits

https://github.com/fooishbar edited 
https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libclc] [libclc] Move sign to the CLC builtins library (PR #115699)

2024-11-19 Thread Daniel Stone via cfe-commits


@@ -322,22 +322,26 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 
 if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
   set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
-  set( opt_flags )
+  set( clc_opt_flags )
+  # Inline CLC functions into OpenCL builtins
+  set( opencl_opt_flags "--passes=always-inline" )

fooishbar wrote:

This from the min/max commit message makes me think we'll be fine:

> Note that clspv and spirv targets don't want to define these functions, so 
> pre-processor macros replace calls to __clc_min with regular min, for 
> example. This means they can use as much of the generic CLC source files
as possible, but where CLC functions would usually call out to an external 
__clc_min symbol, they call out to an external min symbol. Then they opt out of 
defining __clc_min itself in their CLC builtins library.

https://github.com/llvm/llvm-project/pull/115699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits