How to add the Visibility Style and DLL Storage Class to FuncOp?

It doesn’t seem to be supported yet?

You can set the visibility of funcOps:
https://reviews.llvm.org/D91096

There is comdat support on the way. For the rest, you have to figure it out yourself. Maybe the LLVM dialect has already support.

The Fortran people needed comdat support:
https://reviews.llvm.org/D150796

Comdats are supported for globals and functions now, but I’m not sure if there’s a way to track that information through FuncOp. I’m trying to work this out for flang at the moment. I assume changing the definition of FuncOp is a no-go here?

I’ve added a PR here [mlir] Add option to add comdat to all linkonce functions by DavidTruby · Pull Request #65270 · llvm/llvm-project · GitHub to add an option when lowering FuncOps to just always add the any comdat for linkonce functions. For flang at least this is as much as we care about, that might not be true for everyone though so we might need to look at a more fine grained solution too.