This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvm] Add visibility attribute
ClosedPublic

Authored by Dinistro on Mar 10 2023, 6:52 AM.

Details

Summary

This commit introduces the LLVM's visibility attribute and adds it to
both globals and functions.

Furthermore, this commit ensures that "thread_local" is printed in the
correct place and adds a test for that.

Diff Detail

Event Timeline

Dinistro created this revision.Mar 10 2023, 6:52 AM
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
Dinistro requested review of this revision.Mar 10 2023, 6:52 AM
gysit accepted this revision.Mar 10 2023, 7:13 AM

Thanks LGTM module nit comments.

mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
1626

I would move this out of the if condition.

2117

Same as above.

mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
981

nit: attribute ?

mlir/test/Dialect/LLVMIR/global.mlir
96

nit: -> types.

This revision is now accepted and ready to land.Mar 10 2023, 7:13 AM
Dinistro updated this revision to Diff 504141.Mar 10 2023, 7:21 AM
Dinistro marked 4 inline comments as done.

address reviewer comments

This revision was automatically updated to reflect the committed changes.