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

Mehdi Amini llvmlistbot at llvm.org
Wed Sep 27 01:40:10 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()) {
----------------
joker-eph wrote:

Grahh, it's pretty ugly. FuncOp defines it as `OptionalAttr<StrAttr>:$sym_visibility` but symbol table operated with `VisibilityAttr` somehow, this "StringAttr" seems pretty historical. That'll be for another day...

Right now I need to first add the `sym_visibility` to LLVMFuncOp! Seems like this should all be part of the symbol interface though.

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


More information about the Mlir-commits mailing list