[Mlir-commits] [mlir] [MLIR][SparseTensor] Add missing #undef REMUI and DIVUI (PR #188686)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Mar 25 22:55:36 PDT 2026


llvmbot wrote:


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

@llvm/pr-subscribers-mlir

Author: Maksim Levental (makslevental)

<details>
<summary>Changes</summary>

LoopEmitter.cpp and SparseTensorIterator.cpp define REMUI and DIVUI macros but the existing #undef block at the end of each file omits them. This can leak the macros into subsequent translation units in unity builds. See https://discourse.llvm.org/t/rfc-enabling-unity-build/90306 for more info.

"clauded" not coded

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


2 Files Affected:

- (modified) mlir/lib/Dialect/SparseTensor/Transforms/Utils/LoopEmitter.cpp (+2) 
- (modified) mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorIterator.cpp (+2) 


``````````diff
diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/Utils/LoopEmitter.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/Utils/LoopEmitter.cpp
index 684c088eb9b0f..a5225ceffc7b2 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/Utils/LoopEmitter.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/Utils/LoopEmitter.cpp
@@ -990,4 +990,6 @@ std::pair<Operation *, Value> sparse_tensor::genCoIteration(
 #undef ANDI
 #undef SUBI
 #undef MULI
+#undef REMUI
+#undef DIVUI
 #undef SELECT
diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorIterator.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorIterator.cpp
index 61b5ad600a16e..b25e095d4c418 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorIterator.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorIterator.cpp
@@ -1724,4 +1724,6 @@ std::unique_ptr<SparseIterator> sparse_tensor::makeTraverseSubSectIterator(
 #undef ANDI
 #undef SUBI
 #undef MULI
+#undef REMUI
+#undef DIVUI
 #undef SELECT

``````````

</details>


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


More information about the Mlir-commits mailing list