[Mlir-commits] [mlir] [MLIR][Arith] Ensure ConstantOp validates signless integers for vectors (PR #177857)

Jakub Kuderski llvmlistbot at llvm.org
Sun Jan 25 09:23:30 PST 2026


================
@@ -232,9 +232,11 @@ bool arith::ConstantOp::isBuildableWith(Attribute value, Type type) {
   if (!typedAttr || typedAttr.getType() != type)
     return false;
   // Integer values must be signless.
-  if (llvm::isa<IntegerType>(type) &&
-      !llvm::cast<IntegerType>(type).isSignless())
-    return false;
+  auto elemType = getElementTypeOrSelf(type);
+  if (auto intType = dyn_cast<IntegerType>(elemType)) {
----------------
kuhar wrote:

nit
```suggestion
  if (auto intType = dyn_cast<IntegerType>(getElementTypeOrSelf(type))) {
```

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


More information about the Mlir-commits mailing list