[Mlir-commits] [mlir] [mlir][spirv] Add spirv-to-llvm conversion for group operations (PR #115501)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Nov 8 08:02:56 PST 2024


================
@@ -1038,18 +1040,23 @@ static LLVM::LLVMFuncOp lookupOrCreateSPIRVFn(Operation *symbolTable,
       symbolTable->getLoc(), name,
       LLVM::LLVMFunctionType::get(resultType, paramTypes));
   func.setCConv(LLVM::cconv::CConv::SPIR_FUNC);
-  func.setConvergent(true);
+  if (convergent) {
+    func.setConvergent(true);
+  }
   func.setNoUnwind(true);
   func.setWillReturn(true);
   return func;
 }
 
 static LLVM::CallOp createSPIRVBuiltinCall(Location loc, OpBuilder &builder,
                                            LLVM::LLVMFuncOp func,
-                                           ValueRange args) {
+                                           ValueRange args,
+                                           bool convergent = true) {
   auto call = builder.create<LLVM::CallOp>(loc, func, args);
   call.setCConv(func.getCConv());
-  call.setConvergentAttr(func.getConvergentAttr());
+  if (convergent) {
+    call.setConvergentAttr(func.getConvergentAttr());
+  }
----------------
FMarno wrote:

```suggestion

    call.setConvergentAttr(func.getConvergentAttr());
 
```
This already reads the convergent attribute from the declaration

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


More information about the Mlir-commits mailing list