-
Notifications
You must be signed in to change notification settings - Fork 13.9k
[nfc][ctx_prof] Don't try finding callsite annotation for un-instrumentable callsites #109184
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
Merged
mtrofin
merged 1 commit into
main
from
users/mtrofin/09-17-_ctx_prof_don_t_try_finding_callsite_annotation_for_un-instrumentable_callsites
Sep 19, 2024
Merged
[nfc][ctx_prof] Don't try finding callsite annotation for un-instrumentable callsites #109184
mtrofin
merged 1 commit into
main
from
users/mtrofin/09-17-_ctx_prof_don_t_try_finding_callsite_annotation_for_un-instrumentable_callsites
Sep 19, 2024
Conversation
This file contains hidden or 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
@llvm/pr-subscribers-llvm-analysis Author: Mircea Trofin (mtrofin) ChangesReinforcing properties ensured at instrumentation time. Full diff: https://github.com/llvm/llvm-project/pull/109184.diff 1 Files Affected:
diff --git a/llvm/lib/Analysis/CtxProfAnalysis.cpp b/llvm/lib/Analysis/CtxProfAnalysis.cpp
index c29709b613410e..3df72983862d98 100644
--- a/llvm/lib/Analysis/CtxProfAnalysis.cpp
+++ b/llvm/lib/Analysis/CtxProfAnalysis.cpp
@@ -234,16 +234,23 @@ PreservedAnalyses CtxProfAnalysisPrinterPass::run(Module &M,
}
InstrProfCallsite *CtxProfAnalysis::getCallsiteInstrumentation(CallBase &CB) {
- for (auto *Prev = CB.getPrevNode(); Prev; Prev = Prev->getPrevNode())
+ if (!InstrProfCallsite::canInstrumentCallsite(CB))
+ return nullptr;
+ for (auto *Prev = CB.getPrevNode(); Prev; Prev = Prev->getPrevNode()) {
if (auto *IPC = dyn_cast<InstrProfCallsite>(Prev))
return IPC;
+ assert(!isa<CallBase>(Prev) &&
+ "didn't expect to find another call, that's not the callsite "
+ "instrumentation, before an instrumentable callsite");
+ }
return nullptr;
}
InstrProfIncrementInst *CtxProfAnalysis::getBBInstrumentation(BasicBlock &BB) {
for (auto &I : BB)
if (auto *Incr = dyn_cast<InstrProfIncrementInst>(&I))
- return Incr;
+ if (!isa<InstrProfIncrementInstStep>(&I))
+ return Incr;
return nullptr;
}
|
6d23eef
to
1c6e49a
Compare
987562a
to
152a2a9
Compare
1c6e49a
to
bbb3ba0
Compare
152a2a9
to
f654c77
Compare
This was referenced Sep 19, 2024
Base automatically changed from
users/mtrofin/09-17-_ctx_prof_fix_profileannotator_alltakenpathsexit_
to
main
September 19, 2024 04:08
f654c77
to
241afaa
Compare
tmsri
pushed a commit
to tmsri/llvm-project
that referenced
this pull request
Sep 19, 2024
…ntable callsites (llvm#109184) Reinforcing properties ensured at instrumentation time.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reinforcing properties ensured at instrumentation time.