-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[SampleFDO] Support enabling sample loader pass in O0 mode #113985
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 1 commit
9b41a3a
2d4a253
cde256b
efb68d2
1750ff5
eb496bd
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 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2305,9 +2305,10 @@ bool SampleProfileLoader::runOnFunction(Function &F, ModuleAnalysisManager *AM) | |||||||||||
| } | ||||||||||||
| SampleProfileLoaderPass::SampleProfileLoaderPass( | ||||||||||||
| std::string File, std::string RemappingFile, ThinOrFullLTOPhase LTOPhase, | ||||||||||||
| IntrusiveRefCntPtr<vfs::FileSystem> FS) | ||||||||||||
| IntrusiveRefCntPtr<vfs::FileSystem> FS, bool DisableSampleProfileInlining) | ||||||||||||
| : ProfileFileName(File), ProfileRemappingFileName(RemappingFile), | ||||||||||||
| LTOPhase(LTOPhase), FS(std::move(FS)) {} | ||||||||||||
| LTOPhase(LTOPhase), FS(std::move(FS)), | ||||||||||||
| DisableSampleProfileInlining(DisableSampleProfileInlining) {} | ||||||||||||
|
|
||||||||||||
| PreservedAnalyses SampleProfileLoaderPass::run(Module &M, | ||||||||||||
| ModuleAnalysisManager &AM) { | ||||||||||||
|
|
@@ -2326,6 +2327,9 @@ PreservedAnalyses SampleProfileLoaderPass::run(Module &M, | |||||||||||
|
|
||||||||||||
| if (!FS) | ||||||||||||
| FS = vfs::getRealFileSystem(); | ||||||||||||
| if (!DisableSampleLoaderInlining.getNumOccurrences() && | ||||||||||||
| DisableSampleProfileInlining) | ||||||||||||
| DisableSampleLoaderInlining = true; | ||||||||||||
|
||||||||||||
| if (!DisableSampleLoaderInlining.getNumOccurrences() && | |
| DisableSampleProfileInlining) | |
| DisableSampleLoaderInlining = true; | |
| if (!::DisableSampleLoaderInlining.getNumOccurrences()) | |
| this->DisableSampleLoaderInlining = ::DisableSampleLoaderInlining; |
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.
oh I think I misread the variables names. This actually changes the cl::opt setting based on the class parameter... I think that is dangerous then. In a ThinLTO or similar setting we could have multiple threads / LLVMContexts using different settings so we shouldn't just change the global variables...
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.
Ah, good point, I was to avoid setting the global variable in PassBuilderPipelines.cpp, so just learned this can also happen in the pass class. OK, I will try setting a class field.
Uh oh!
There was an error while loading. Please reload this page.