Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CIR][CIRGen] More on dsolocal: visibility improvements #735

Merged
merged 4 commits into from
Jul 12, 2024

Conversation

ghehg
Copy link
Collaborator

@ghehg ghehg commented Jul 12, 2024

In this PR, we

  1. implement defaultVisibility as far as dsolocal is concerned, currently is either MLIR::Visibility isPublic() or isPrivate(). Now, we don't handle hiddenVisibility and protectedVisibility from AST. I put missFeature assert so that If in anyway we translate hiddenVisibility or protectedVisibility into mlir::SymbolTable::Visibility::Private (hopefully not for it'd be confusing), then we need to revise this defaultVisibility setting.
  2. call setNonAliasAttributes on global op upon discovery of its initialization, thus we have globals dso_local correctly set.

Still missing is lots of function should have dso_local set, but the all depend on comDat implementation, which will come from next PR within the next few days.

@bcardosolopes bcardosolopes changed the title [CIR][Codegen]call [CIR][CIRGen] More on dsolocal: visibility improvements Jul 12, 2024
// in the context of MILR and CIR, now we default to
assert(!MissingFeatures::setDefaultVisibility());
return true;
static bool hasDefaultVisibilityForDsoLocal(CIRGlobalValueInterface GV) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow OG codegen skeleton, I don't see a good reason for the name change here, or at least make it a helper but keep the entry point hasDefaultVisibility

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, LGTM

@bcardosolopes bcardosolopes merged commit 5d9732a into llvm:main Jul 12, 2024
6 checks passed
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
In this PR, we 
1. implement defaultVisibility as far as dsolocal is concerned,
currently is either MLIR::Visibility isPublic() or isPrivate(). Now, we
don't handle hiddenVisibility and protectedVisibility from AST. I put
missFeature assert so that If in anyway we translate hiddenVisibility or
protectedVisibility into mlir::SymbolTable::Visibility::Private
(hopefully not for it'd be confusing), then we need to revise this
defaultVisibility setting.
2. call setNonAliasAttributes on global op upon discovery of its
initialization, thus we have globals dso_local correctly set.

Still missing is lots of function should have dso_local set, but the all
depend on comDat implementation, which will come from next PR within the
next few days.
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
In this PR, we 
1. implement defaultVisibility as far as dsolocal is concerned,
currently is either MLIR::Visibility isPublic() or isPrivate(). Now, we
don't handle hiddenVisibility and protectedVisibility from AST. I put
missFeature assert so that If in anyway we translate hiddenVisibility or
protectedVisibility into mlir::SymbolTable::Visibility::Private
(hopefully not for it'd be confusing), then we need to revise this
defaultVisibility setting.
2. call setNonAliasAttributes on global op upon discovery of its
initialization, thus we have globals dso_local correctly set.

Still missing is lots of function should have dso_local set, but the all
depend on comDat implementation, which will come from next PR within the
next few days.
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
In this PR, we 
1. implement defaultVisibility as far as dsolocal is concerned,
currently is either MLIR::Visibility isPublic() or isPrivate(). Now, we
don't handle hiddenVisibility and protectedVisibility from AST. I put
missFeature assert so that If in anyway we translate hiddenVisibility or
protectedVisibility into mlir::SymbolTable::Visibility::Private
(hopefully not for it'd be confusing), then we need to revise this
defaultVisibility setting.
2. call setNonAliasAttributes on global op upon discovery of its
initialization, thus we have globals dso_local correctly set.

Still missing is lots of function should have dso_local set, but the all
depend on comDat implementation, which will come from next PR within the
next few days.
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
In this PR, we 
1. implement defaultVisibility as far as dsolocal is concerned,
currently is either MLIR::Visibility isPublic() or isPrivate(). Now, we
don't handle hiddenVisibility and protectedVisibility from AST. I put
missFeature assert so that If in anyway we translate hiddenVisibility or
protectedVisibility into mlir::SymbolTable::Visibility::Private
(hopefully not for it'd be confusing), then we need to revise this
defaultVisibility setting.
2. call setNonAliasAttributes on global op upon discovery of its
initialization, thus we have globals dso_local correctly set.

Still missing is lots of function should have dso_local set, but the all
depend on comDat implementation, which will come from next PR within the
next few days.
lanza pushed a commit that referenced this pull request Nov 5, 2024
In this PR, we 
1. implement defaultVisibility as far as dsolocal is concerned,
currently is either MLIR::Visibility isPublic() or isPrivate(). Now, we
don't handle hiddenVisibility and protectedVisibility from AST. I put
missFeature assert so that If in anyway we translate hiddenVisibility or
protectedVisibility into mlir::SymbolTable::Visibility::Private
(hopefully not for it'd be confusing), then we need to revise this
defaultVisibility setting.
2. call setNonAliasAttributes on global op upon discovery of its
initialization, thus we have globals dso_local correctly set.

Still missing is lots of function should have dso_local set, but the all
depend on comDat implementation, which will come from next PR within the
next few days.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants