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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Oct 5 19:09:48 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-tosa

@llvm/pr-subscribers-mlir

Author: Vitaly Buka (vitalybuka)

<details>
<summary>Changes</summary>

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


---
Full diff: https://github.com/llvm/llvm-project/pull/229292.diff


1 Files Affected:

- (modified) mlir/lib/Dialect/Tosa/Transforms/TosaProfileCompliance.cpp (+7-6) 


``````````diff
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

``````````

</details>


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


More information about the Mlir-commits mailing list