================ @@ -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" ) ---------------- frasercrmck wrote:
Thanks for letting me know, that's useful information to consider. I have seen issues with LLVM optimizations generating invalid (or at least unwanted) SPIR-V in the past, so it's good to be reminded of that. It sounds as though you don't want any inlining, which is fair enough. Inlining builtins would always be a danger if I make this change. I note that in the current libclc library for SPIR-V (before any of my recent refactoring) we have calls to "internal "__clc" functions such as `__clc_tanpi`, `__clc_rootn`, etc. So perhaps it's fine if this and future PRs introduce more of those e.g. `sign` calling `__clc_sign`? I can undo the change which adds the `always_inline` attribute to CLC functions, and undo the change that runs `opt --passes=always-inline` for SPIR-V. Does that sound okay? 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