Skip to content

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
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Reentry #135656

wants to merge 1 commit into from

Conversation

mtrofin
Copy link
Member

@mtrofin mtrofin commented Apr 14, 2025

No description provided.

Copy link
Member Author

mtrofin commented Apr 14, 2025

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.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

github-actions bot commented Apr 14, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

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) {

@mtrofin mtrofin force-pushed the users/mtrofin/04-14-_ctxprof_extend_the_notion_of_cannot_return_ branch from 9642055 to ea62923 Compare April 14, 2025 18:30
@mtrofin mtrofin force-pushed the users/mtrofin/04-14-reentry branch from e7b5f81 to 978d61c Compare April 14, 2025 18:30
@mtrofin mtrofin force-pushed the users/mtrofin/04-14-_ctxprof_extend_the_notion_of_cannot_return_ branch from ea62923 to d59208d Compare April 15, 2025 20:57
@mtrofin mtrofin force-pushed the users/mtrofin/04-14-reentry branch 2 times, most recently from b661a51 to 97e8169 Compare April 15, 2025 21:35
@mtrofin mtrofin force-pushed the users/mtrofin/04-14-_ctxprof_extend_the_notion_of_cannot_return_ branch from d59208d to 5a7d95a Compare April 15, 2025 21:35
@mtrofin mtrofin force-pushed the users/mtrofin/04-14-reentry branch from 97e8169 to 0c336ea Compare April 15, 2025 21:45
@mtrofin mtrofin force-pushed the users/mtrofin/04-14-_ctxprof_extend_the_notion_of_cannot_return_ branch from 5a7d95a to c43aeb1 Compare April 15, 2025 21:45
@mtrofin mtrofin force-pushed the users/mtrofin/04-14-reentry branch from 0c336ea to d4b02b8 Compare April 16, 2025 01:03
@mtrofin mtrofin force-pushed the users/mtrofin/04-14-_ctxprof_extend_the_notion_of_cannot_return_ branch from c43aeb1 to 6cc7a0c Compare April 16, 2025 01:03
@mtrofin mtrofin force-pushed the users/mtrofin/04-14-reentry branch from d4b02b8 to caa4002 Compare April 16, 2025 14:56
@mtrofin mtrofin force-pushed the users/mtrofin/04-14-_ctxprof_extend_the_notion_of_cannot_return_ branch 2 times, most recently from 5f26ea3 to ab506b5 Compare April 16, 2025 14:56
@mtrofin mtrofin force-pushed the users/mtrofin/04-14-reentry branch from caa4002 to 82a5255 Compare April 16, 2025 14:56
@mtrofin mtrofin force-pushed the users/mtrofin/04-14-_ctxprof_extend_the_notion_of_cannot_return_ branch from ab506b5 to 928963c Compare April 16, 2025 15:08
@mtrofin mtrofin force-pushed the users/mtrofin/04-14-reentry branch from 82a5255 to d2502c8 Compare April 16, 2025 15:08
Base automatically changed from users/mtrofin/04-14-_ctxprof_extend_the_notion_of_cannot_return_ to main April 16, 2025 17:39
@mtrofin mtrofin force-pushed the users/mtrofin/04-14-reentry branch from d2502c8 to b10c2e2 Compare April 16, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant