2 Commits

Author SHA1 Message Date
Asher Mancinelli
ad92174077
[MLIR][LLVM] Fix uses of LLVM's visibility attr (#173024)
I noticed that I was using LLVM::VisibilityAttr::name when looking for
the attribute on LLVM ops, but LLVM::VisibilityAttr::name is just
"builtin.integer"... Now we switch on the types of the specific ops we would
like to match, and use the getters/setters for the attribute directly instead of
the deprecated setAttr/getAttr.
2025-12-19 09:52:10 -08:00
Asher Mancinelli
568ce76c6e
[MLIR][LLVM] Add pass to update ops with default visibility (#171727)
To support the `-fvisibility=...` option in Flang, we need a pass to
rewrite all the global definitions in the LLVM dialect that have the
default visibility to have the specified visibility. This change adds
such a pass.

Note that I did not add an option for `visiblity=default`; I believe
this makes sense for compiler drivers since users may want to tack an
option on at the end of a compile line to override earlier options, but
I don't think it makes sense for this pass to accept
`visibility=default`--it would just be an early exit IIUC.
2025-12-12 06:49:20 -08:00