[Mlir-commits] [mlir] [NFC][mlir][tosa] Use optnone for compliance initialization under ASan (PR #229292)

Vitaly Buka llvmlistbot at llvm.org
Mon Oct 5 19:04:10 PDT 2026


https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/229292

Similar to #223586 and #226310, compiling the ~5,000-line generated
initializer in `TosaProfileCompliance::TosaProfileCompliance()` is also
very slow under AddressSanitizer.

Mark the constructor with `optnone` under `LLVM_ADDRESS_SANITIZER_BUILD`
as well to skip expensive optimization and register allocation passes.

Assisted-by: Gemini


>From 6ad06d5e1e249354d74756474da534a20efaf13b Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Mon, 5 Oct 2026 19:03:53 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.7
---
 .../Tosa/Transforms/TosaProfileCompliance.cpp       | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaProfileCompliance.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaProfileCompliance.cpp
index a9dea6c86b28e..8a692280da682 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/TosaProfileCompliance.cpp
+++ b/mlir/lib/Dialect/Tosa/Transforms/TosaProfileCompliance.cpp
@@ -14,12 +14,13 @@
 using namespace mlir;
 using namespace mlir::tosa;
 
-// Building this ~5,000-line generated initializer map under HWAddressSanitizer
-// or MemorySanitizer leads to extreme compile times (>3.5 minutes) during
-// InstCombine and greedy register allocation due to instrumentation
-// overhead. Disable optimization under MSan/HWAsan to keep build times
-// manageable.
-#if LLVM_MEMORY_SANITIZER_BUILD || LLVM_HWADDRESS_SANITIZER_BUILD
+// Building this ~5,000-line generated initializer map under AddressSanitizer,
+// HWAddressSanitizer, or MemorySanitizer leads to extreme compile times (>3.5
+// minutes) during InstCombine and greedy register allocation due to
+// instrumentation overhead. Disable optimization under ASan/HWAsan/MSan to keep
+// build times manageable.
+#if LLVM_ADDRESS_SANITIZER_BUILD || LLVM_HWADDRESS_SANITIZER_BUILD ||          \
+    LLVM_MEMORY_SANITIZER_BUILD
 __attribute__((optnone))
 #else
 LLVM_ATTRIBUTE_MINSIZE



More information about the Mlir-commits mailing list