[Mlir-commits] [mlir] [MLIR][LLVM] Fix #llvm.constant_range crashing in storage uniquer (PR #135772)

Henrich Lauko llvmlistbot at llvm.org
Tue Apr 15 10:06:37 PDT 2025


================
@@ -1094,9 +1094,8 @@ def LLVM_TBAATagArrayAttr
 // ConstantRangeAttr
 //===----------------------------------------------------------------------===//
 def LLVM_ConstantRangeAttr : LLVM_Attr<"ConstantRange", "constant_range"> {
-  let parameters = (ins
-    "::llvm::APInt":$lower,
-    "::llvm::APInt":$upper
+  let parameters = (ins APIntParameter<"">:$lower,
+    APIntParameter<"">:$upper
----------------
xlauko wrote:

I found only:

- https://github.com/trail-of-forks/llvm-project/blob/bba2507c19ff678c5d7b18e0b220406be87451fe/mlir/include/mlir/IR/BuiltinAttributes.td#L683
- https://github.com/llvm/llvm-project/blob/a9553990fb6de8b4d99d05c95fe949deef6357e1/mlir/docs/DefiningDialects/AttributesAndTypes.md?plain=1#L127

We discussed with @gysit in side channel that it might be worthwhile to add a check to tablegen to warn on `APInt` use and suggest `APIntParameter` instead.

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


More information about the Mlir-commits mailing list