[Mlir-commits] [mlir] [mlir][docs] Add poison example to canonicalization section (PR #192782)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Apr 18 02:49:03 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Matthias Springer (matthias-springer)

<details>
<summary>Changes</summary>

Mention that folding to `ub.poison` is a common canonicalization.


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


1 Files Affected:

- (modified) mlir/docs/Canonicalization.md (+2) 


``````````diff
diff --git a/mlir/docs/Canonicalization.md b/mlir/docs/Canonicalization.md
index 6f48e60c94962..6fbcf09c51df3 100644
--- a/mlir/docs/Canonicalization.md
+++ b/mlir/docs/Canonicalization.md
@@ -96,6 +96,8 @@ canonicalizations include:
   rewriting `tensor.insert_slice(%src, tensor.cast(%dst))` (where the cast
   converts from `tensor<5xf32>` to `tensor<?xf32>`) as
   `tensor.cast(tensor.insert_slice(%src, %dst))`.
+* Replacing poisoned results with `ub.poison`. E.g., replacing
+  `arith.divsi(%c5, %c2, exact)` with `ub.poison`.
 
 
 Note: Some canonicalizations do not apply when they would lead to IR size

``````````

</details>


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


More information about the Mlir-commits mailing list