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

Tobias Gysi llvmlistbot at llvm.org
Wed Sep 27 02:22:47 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:

PS would it make sense to add a small test case to the func to llvm conversion tests?

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


More information about the Mlir-commits mailing list