-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Clang][Driver] Enable internalization by default for AMDGPU #138365
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -9284,6 +9284,12 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA, | |||
CmdArgs.push_back(Args.MakeArgString( | ||||
"--device-linker=" + TC->getTripleString() + "=" + Arg)); | ||||
|
||||
// Enable internalization for AMDGPU. | ||||
if (TC->getTriple().isAMDGPU()) | ||||
CmdArgs.push_back( | ||||
Args.MakeArgString("--device-linker=" + TC->getTripleString() + | ||||
"=-plugin-opt=-amdgpu-internalize-symbols")); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I forget what this hacked around, was hoping we didn't need it anymore. Maybe @arsenm remembers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really a hack TBH, though we are the only target explicitly using it. It significantly affects our performance. The remaining uses of this pass are in (Thin)LTO, which has broader impact. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks more like "always" than "by default". The implementation details are kind of a hack. We should be able to just run the ordinary internalize pass without the special AMDGPU filter.
The most legitimate part of this is the isEntryFunctionCC, which we could just make the internalize pass directly do. The sanitizer name hacks are also obviously hacks. The attempt to drop constant users looks like a bad side effect a predicate should not have, I don't know what that's doing there There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have an example of what kind of functions aren't being internalized? Last time I had this issue it's because the ROCm Device Libs were compiling with |
||||
|
||||
// Forward the LTO mode relying on the Driver's parsing. | ||||
if (C.getDriver().getOffloadLTOMode() == LTOK_Full) | ||||
CmdArgs.push_back(Args.MakeArgString( | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Braces