[Mlir-commits] [llvm] [mlir] [mlir][LLVM] handle argument and result attributes in llvm.call and llvm.invoke (PR #123177)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Feb 10 06:51:10 PST 2025


================
@@ -224,6 +224,34 @@ static void convertLinkerOptionsOp(ArrayAttr options,
   linkerMDNode->addOperand(listMDNode);
 }
 
+static LogicalResult
+convertParameterAndResultAttrs(CallOpInterface callOp, llvm::CallBase *call,
+                               LLVM::ModuleTranslation &moduleTranslation) {
+  if (ArrayAttr argAttrsArray = callOp.getArgAttrsAttr()) {
+    for (auto [argIdx, argAttrsAttr] : llvm::enumerate(argAttrsArray)) {
+      if (auto argAttrs = llvm::cast<DictionaryAttr>(argAttrsAttr)) {
----------------
jeanPerier wrote:

Thanks, I wanted to check that it is not empty and for some reason assumed there was a Boolean operator for DictionaryAttr... Updated to explicitly check if the dictionary is empty.

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


More information about the Mlir-commits mailing list