-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Reentry #135656
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
Draft
mtrofin
wants to merge
1
commit into
main
Choose a base branch
from
users/mtrofin/04-14-reentry
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Reentry #135656
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
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
You can test this locally with the following command:git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- compiler-rt/lib/ctx_profile/CtxInstrProfiling.cpp compiler-rt/lib/ctx_profile/tests/CtxInstrProfilingTest.cpp llvm/include/llvm/ProfileData/CtxInstrContextNode.h llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp View the diff from clang-format here.diff --git a/compiler-rt/lib/ctx_profile/CtxInstrProfiling.cpp b/compiler-rt/lib/ctx_profile/CtxInstrProfiling.cpp
index 2e26541c1..0261bab53 100644
--- a/compiler-rt/lib/ctx_profile/CtxInstrProfiling.cpp
+++ b/compiler-rt/lib/ctx_profile/CtxInstrProfiling.cpp
@@ -55,7 +55,7 @@ void onFunctionExited(void *Address) {
}
// Returns true if it was entered the first time
-bool rootEnterIsFirst(void* Address) {
+bool rootEnterIsFirst(void *Address) {
bool Ret = true;
if (!EnteredContextAddress) {
EnteredContextAddress = Address;
@@ -67,14 +67,13 @@ bool rootEnterIsFirst(void* Address) {
}
// Return true if this also exits the root.
-bool exitsRoot(void* Address) {
+bool exitsRoot(void *Address) {
onFunctionExited(Address);
if (UnderContextRefCount == 0) {
EnteredContextAddress = nullptr;
return true;
}
return false;
-
}
bool hasEnteredARoot() { return UnderContextRefCount > 0; }
@@ -367,8 +366,7 @@ ContextNode *getOrStartContextOutsideCollection(FunctionData &Data,
// If we didn't start profiling, or if we are under a context, just not
// collecting, return the scratch buffer.
- if (hasEnteredARoot() ||
- !__sanitizer::atomic_load_relaxed(&ProfilingStarted))
+ if (hasEnteredARoot() || !__sanitizer::atomic_load_relaxed(&ProfilingStarted))
return TheScratchContext;
return markAsScratch(
onContextEnter(*getFlatProfile(Data, Callee, Guid, NumCounters)));
diff --git a/compiler-rt/lib/ctx_profile/tests/CtxInstrProfilingTest.cpp b/compiler-rt/lib/ctx_profile/tests/CtxInstrProfilingTest.cpp
index 39a225ac1..064608d28 100644
--- a/compiler-rt/lib/ctx_profile/tests/CtxInstrProfilingTest.cpp
+++ b/compiler-rt/lib/ctx_profile/tests/CtxInstrProfilingTest.cpp
@@ -276,7 +276,7 @@ TEST_F(ContextTest, RootEntersOtherRoot) {
__llvm_ctx_profile_release_context(&Root);
EXPECT_EQ(__llvm_ctx_profile_current_context_root, Root.CtxRoot);
__llvm_ctx_profile_release_context(&Root);
- EXPECT_EQ(__llvm_ctx_profile_current_context_root, nullptr);
+ EXPECT_EQ(__llvm_ctx_profile_current_context_root, nullptr);
}
TEST_F(ContextTest, NeedMoreMemory) {
|
9642055
to
ea62923
Compare
e7b5f81
to
978d61c
Compare
ea62923
to
d59208d
Compare
b661a51
to
97e8169
Compare
d59208d
to
5a7d95a
Compare
97e8169
to
0c336ea
Compare
5a7d95a
to
c43aeb1
Compare
0c336ea
to
d4b02b8
Compare
c43aeb1
to
6cc7a0c
Compare
d4b02b8
to
caa4002
Compare
5f26ea3
to
ab506b5
Compare
caa4002
to
82a5255
Compare
ab506b5
to
928963c
Compare
82a5255
to
d2502c8
Compare
Base automatically changed from
users/mtrofin/04-14-_ctxprof_extend_the_notion_of_cannot_return_
to
main
April 16, 2025 17:39
d2502c8
to
b10c2e2
Compare
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.
No description provided.