[Mlir-commits] [mlir] [mlir][spirv] Check output of getConstantInt (PR #140568)

Lei Zhang llvmlistbot at llvm.org
Sun May 25 08:10:54 PDT 2025


================
@@ -1061,12 +1061,19 @@ LogicalResult spirv::Deserializer::processCooperativeMatrixTypeKHR(
            << operands[2];
   }
 
-  unsigned rows = getConstantInt(operands[3]).getInt();
-  unsigned columns = getConstantInt(operands[4]).getInt();
+  IntegerAttr rowsAttr = getConstantInt(operands[3]);
+  assert(rowsAttr);
----------------
antiagainst wrote:

What about using `emitError` to print a proper error message rather than aborting the compiler?

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


More information about the Mlir-commits mailing list