diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp index f99339852824c..55119984d9cc1 100644 --- a/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp +++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp @@ -723,7 +723,9 @@ void mlir::spirv::ConstantOp::getAsmResultNames( IntegerType intTy = llvm::dyn_cast(type); if (IntegerAttr intCst = llvm::dyn_cast(getValue())) { - if (intTy && intTy.getWidth() == 1) { + assert(intTy); + + if (intTy.getWidth() == 1) { return setNameFn(getResult(), (intCst.getInt() ? "true" : "false")); }