[clang] [compiler-rt] [llvm] [TSan] Use EscapeAnalysis to eliminate redundant instrumentation (PR #192945)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 08:16:02 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- llvm/include/llvm/Analysis/EscapeAnalysis.h llvm/lib/Analysis/EscapeAnalysis.cpp llvm/lib/Passes/PassBuilder.cpp llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Analysis/EscapeAnalysis.cpp b/llvm/lib/Analysis/EscapeAnalysis.cpp
index dfbc8ec7d..808dd4a38 100644
--- a/llvm/lib/Analysis/EscapeAnalysis.cpp
+++ b/llvm/lib/Analysis/EscapeAnalysis.cpp
@@ -646,8 +646,7 @@ bool EscapeAnalysisInfo::solveEscapeFor(
   if (SawCycle)
     *SawCycle |= LocalSawCycle;
 
-  LLVM_DEBUG(dbgs() << "  Result: "
-                    << (Escaped ? "escaped" : "not escaped")
+  LLVM_DEBUG(dbgs() << "  Result: " << (Escaped ? "escaped" : "not escaped")
                     << "\n");
   return Escaped;
 }
diff --git a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
index 7081cc9b1..cb7e2c30e 100644
--- a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
@@ -25,6 +25,7 @@
 #include "llvm/ADT/Statistic.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Analysis/CaptureTracking.h"
+#include "llvm/Analysis/EscapeAnalysis.h"
 #include "llvm/Analysis/TargetLibraryInfo.h"
 #include "llvm/Analysis/ValueTracking.h"
 #include "llvm/IR/DataLayout.h"
@@ -41,7 +42,6 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
-#include "llvm/Analysis/EscapeAnalysis.h"
 #include "llvm/Transforms/Utils/EscapeEnumerator.h"
 #include "llvm/Transforms/Utils/Instrumentation.h"
 #include "llvm/Transforms/Utils/Local.h"

``````````

</details>


https://github.com/llvm/llvm-project/pull/192945


More information about the cfe-commits mailing list