[llvm] [msan] Convert target("aarch64.svcount") from compile-time crash to MSan false negatives (PR #165028)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 24 12:17:17 PDT 2025


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 -- llvm/lib/Transforms/Instrumentation/MemorySanitizer.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/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
index 5949c2baf..0ca19794e 100644
--- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -1549,7 +1549,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
     if (!isa<TargetExtType>(Ty))
       return false;
 
-    TargetExtType* TTy = cast<TargetExtType>(Ty);
+    TargetExtType *TTy = cast<TargetExtType>(Ty);
     return TTy->getName() == "aarch64.svcount";
   }
 
@@ -1557,7 +1557,8 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
   // 'target("aarch64.svcount")', but not e.g., <vscale x 4 x i32>.
   static bool isScalableNonVectorType(Type *Ty) {
     if (!isAArch64SVCount(Ty))
-      LLVM_DEBUG(dbgs() << "isScalableNonVectorType: Unexpected type " << *Ty << "\n");
+      LLVM_DEBUG(dbgs() << "isScalableNonVectorType: Unexpected type " << *Ty
+                        << "\n");
 
     return Ty->isScalableTy() && !isa<VectorType>(Ty);
   }
@@ -1694,8 +1695,9 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
       LLVM_DEBUG(dbgs() << "getShadowTy: " << *ST << " ===> " << *Res << "\n");
       return Res;
     }
-    if (isScalableNonVectorType(OrigTy)){
-      LLVM_DEBUG(dbgs() << "getShadowTy: Scalable non-vector type: " << *OrigTy << "\n");
+    if (isScalableNonVectorType(OrigTy)) {
+      LLVM_DEBUG(dbgs() << "getShadowTy: Scalable non-vector type: " << *OrigTy
+                        << "\n");
       return OrigTy;
     }
 

``````````

</details>


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


More information about the llvm-commits mailing list