[Mlir-commits] [mlir] 9e69e85 - [NFC][mlir][tosa] Use optnone for compliance initialization under ASan (#229292)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Oct 5 19:16:24 PDT 2026
Author: Vitaly Buka
Date: 2026-10-06T02:16:17Z
New Revision: 9e69e851a1f86a44b6cf35cb6be0879c47ae6505
URL: https://github.com/llvm/llvm-project/commit/9e69e851a1f86a44b6cf35cb6be0879c47ae6505
DIFF: https://github.com/llvm/llvm-project/commit/9e69e851a1f86a44b6cf35cb6be0879c47ae6505.diff
LOG: [NFC][mlir][tosa] Use optnone for compliance initialization under ASan (#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
Added:
Modified:
mlir/lib/Dialect/Tosa/Transforms/TosaProfileCompliance.cpp
Removed:
################################################################################
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