[Mlir-commits] [mlir] Update MLIR conversion to LLVMFunc to account better for properties (PR #67406)

Tobias Gysi llvmlistbot at llvm.org
Wed Sep 27 01:00:29 PDT 2023


================
@@ -73,42 +73,37 @@ static bool shouldUseBarePtrCallConv(Operation *op,
 /// Only retain those attributes that are not constructed by
 /// `LLVMFuncOp::build`. If `filterArgAttrs` is set, also filter out argument
 /// attributes.
-static void filterFuncAttributes(func::FuncOp func, bool filterArgAndResAttrs,
+static void filterFuncAttributes(func::FuncOp func,
                                  SmallVectorImpl<NamedAttribute> &result) {
-  for (const NamedAttribute &attr : func->getAttrs()) {
-    if (attr.getName() == SymbolTable::getSymbolAttrName() ||
-        attr.getName() == func.getFunctionTypeAttrName() ||
-        attr.getName() == linkageAttrName ||
+  for (const NamedAttribute &attr : func->getDiscardableAttrs()) {
----------------
gysit wrote:

It seems like the flang tests expect that the `sym_visibility` is copied as well (which is an inherent attribute on FuncOp). I suspect this is actually necessary since it is orthogonal information to the linkage.

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


More information about the Mlir-commits mailing list