-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[SampleFDO] Stale profile call-graph matching #95135
Merged
Merged
Changes from 18 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
622d78f
[SampleFDO] Stale profile renaming matching
wlei-llvm c7ada8b
addressing comments
wlei-llvm 183f6ae
fix test & udpate non-inline call targets & addressing comments
wlei-llvm 6beddf2
addressing comments
wlei-llvm 7f38b7e
change ProfCallee to ProfFunc
wlei-llvm ae436dd
early break for non-inline callees match when NewIRCallees is empty
wlei-llvm 7cb0cd7
refactoring findOrMatchFunction
wlei-llvm beaa601
addressing comments
wlei-llvm c61ee03
fix comment
wlei-llvm 81811c3
run matching in top-down order and along with CFG matching
wlei-llvm 4bdda81
add stats
wlei-llvm df77394
FunctionProfileNameMap to FuncToProfileNameMap and fix lint
wlei-llvm d001406
fix varibale name
wlei-llvm 8fc8f54
fix typo and incorrect comments
wlei-llvm ecc4000
addressing comment: build its own top-down function for matcher
wlei-llvm da8b752
addressing comment
wlei-llvm 93d70fa
addressing feedback
wlei-llvm 8c36fcc
add test for recursive case
wlei-llvm dc4d4f9
renaming and fix comments
wlei-llvm c7ae1a9
Merge branch 'main' into call-graph-matching
wlei-llvm 7b458b4
rename to FunctionsWithoutProfile
wlei-llvm 15e8d0c
refactor functionHasProfile
wlei-llvm 47c1816
fix use-after-free
wlei-llvm 82cf2a6
Merge branch 'main' into call-graph-matching
wlei-llvm 845ebe3
Merge branch 'llvm:main' into call-graph-matching
wlei-llvm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
#include "llvm/ADT/SmallPtrSet.h" | ||
#include "llvm/ADT/SmallSet.h" | ||
#include "llvm/ADT/SmallVector.h" | ||
#include "llvm/Analysis/LazyCallGraph.h" | ||
#include "llvm/Analysis/LoopInfo.h" | ||
#include "llvm/Analysis/OptimizationRemarkEmitter.h" | ||
#include "llvm/Analysis/PostDominators.h" | ||
|
@@ -155,6 +156,22 @@ static inline bool skipProfileForFunction(const Function &F) { | |
return F.isDeclaration() || !F.hasFnAttribute("use-sample-profile"); | ||
} | ||
|
||
static inline void | ||
buildTopDownFuncOrder(LazyCallGraph &CG, | ||
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 function actually yields bottom-up order. 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. Fixed the name |
||
std::vector<Function *> &FunctionOrderList) { | ||
CG.buildRefSCCs(); | ||
for (LazyCallGraph::RefSCC &RC : CG.postorder_ref_sccs()) { | ||
for (LazyCallGraph::SCC &C : RC) { | ||
for (LazyCallGraph::Node &N : C) { | ||
Function &F = N.getFunction(); | ||
if (!skipProfileForFunction(F)) | ||
FunctionOrderList.push_back(&F); | ||
} | ||
} | ||
} | ||
std::reverse(FunctionOrderList.begin(), FunctionOrderList.end()); | ||
} | ||
|
||
template <typename FT> class SampleProfileLoaderBaseImpl { | ||
public: | ||
SampleProfileLoaderBaseImpl(std::string Name, std::string RemapName, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit:
two callsite anchors
->two sequences of callsite anchors