[Mlir-commits] [mlir] [MLIR][GPU] Support grid constant, byval, byref on gpu.func (PR #172037)

Mehdi Amini llvmlistbot at llvm.org
Fri Dec 12 08:19:17 PST 2025


================
@@ -5443,7 +5443,8 @@ LogicalResult NVVMDialect::verifyRegionArgAttribute(Operation *op,
   if (!funcOp)
     return success();
 
-  bool isKernel = op->hasAttr(NVVMDialect::getKernelFuncAttrName());
+  const bool isKernel = op->hasAttr(NVVMDialect::getKernelFuncAttrName()) ||
+                        op->hasAttr(gpu::GPUDialect::getKernelFuncAttrName());
   StringAttr attrName = argAttr.getName();
   if (attrName == NVVM::NVVMDialect::getGridConstantAttrName()) {
----------------
joker-eph wrote:

```suggestion
  StringAttr attrName = argAttr.getName();
  if (attrName != NVVM::NVVMDialect::getGridConstantAttrName())
    return sucess();
  const bool isKernel = op->hasAttr(NVVMDialect::getKernelFuncAttrName()) ||
                        op->hasAttr(gpu::GPUDialect::getKernelFuncAttrName());
```


Since we're here: just a nit about early-exit.

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


More information about the Mlir-commits mailing list