[mlir] [llvm] [mlir][nvvm]Add support for grid_constant attribute on LLVM function arguments (PR #78228)

Rishi Surendran via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 28 20:20:35 PST 2024


================
@@ -90,6 +102,20 @@ class LLVMTranslationInterface
     }
     return success();
   }
+
+  /// Acts on the given function operation using the interface implemented by
+  /// the dialect of one of the function parameter attributes.
+  virtual LogicalResult
+  convertParameterAttr(LLVM::LLVMFuncOp function, int argIdx,
+                       NamedAttribute attribute,
+                       LLVM::ModuleTranslation &moduleTranslation) const {
+    if (const LLVMTranslationDialectInterface *iface =
+            getInterfaceFor(attribute.getNameDialect())) {
+      return iface->convertParameterAttr(function, argIdx, attribute,
+                                         moduleTranslation);
+    }
+    return success();
----------------
rishisurendran wrote:

Returning failure causes several test failures. There are dialect attributes like 'fir.bindc_name' which doesn't require any handling here. I updated it to emit a warning.

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


More information about the llvm-commits mailing list