[Mlir-commits] [mlir] [mlir][nvvm]Add support for grid_constant attribute on LLVM function arguments (PR #78228)
Oleksandr Alex Zinenko
llvmlistbot at llvm.org
Tue Jan 16 01:41:32 PST 2024
================
@@ -1077,6 +1077,34 @@ LogicalResult NVVMDialect::verifyOperationAttribute(Operation *op,
return success();
}
+LogicalResult NVVMDialect::verifyRegionArgAttribute(Operation *op,
+ unsigned regionIndex,
+ unsigned argIndex,
+ NamedAttribute argAttr) {
+ auto funcOp = dyn_cast<FunctionOpInterface>(op);
+ if (!funcOp)
+ return success();
+
+ bool isKernel = op->hasAttr(NVVMDialect::getKernelFuncAttrName());
+ auto attrName = argAttr.getName();
+ if (attrName == NVVM::NVVMDialect::getGridConstantAttrName()) {
+ if (!isKernel)
+ return op->emitError()
+ << "'" << attrName
+ << "' attribute must be present only on kernel arguments.";
----------------
ftynse wrote:
Nit: don't end an error message with a period. Here and below.
https://github.com/llvm/llvm-project/pull/78228
More information about the Mlir-commits
mailing list