[Mlir-commits] [mlir] [MLIR] Add optimization attrs for gpu-to-llvmspv function declarations (PR #99301)

Victor Perez llvmlistbot at llvm.org
Wed Jul 17 03:52:26 PDT 2024


================
@@ -53,6 +52,17 @@ static LLVM::LLVMFuncOp lookupOrCreateSPIRVFn(Operation *symbolTable,
         symbolTable->getLoc(), name,
         LLVM::LLVMFunctionType::get(resultType, paramTypes));
     func.setCConv(LLVM::cconv::CConv::SPIR_FUNC);
+    func.setNoUnwind(true);
+    func.setWillReturn(true);
----------------
victor-eds wrote:

We shouldn't be adding `willreturn` to all operations. Add it only to the builtins, please. `barrier()` and `sub_group_shuffle()` may not return if not all work-items execute the function. You can pass an additional argument to the function.

https://github.com/llvm/llvm-project/pull/99301


More information about the Mlir-commits mailing list