diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp --- a/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp +++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp @@ -2124,6 +2124,8 @@ if (intTy.isSignless()) { specialName << intCst.getInt(); + } else if (intTy.isUnsigned()) { + specialName << intCst.getUInt(); } else { specialName << intCst.getSInt(); } diff --git a/mlir/test/Conversion/PDLToPDLInterp/pdl-to-pdl-interp-uint.mlir b/mlir/test/Conversion/PDLToPDLInterp/pdl-to-pdl-interp-uint.mlir new file mode 100644 --- /dev/null +++ b/mlir/test/Conversion/PDLToPDLInterp/pdl-to-pdl-interp-uint.mlir @@ -0,0 +1,8 @@ +// RUN: mlir-opt -split-input-file -convert-pdl-to-pdl-interp %s | FileCheck %s + +// CHECK:spirv.func @func() +// CHECK-NEXT:%cst0_ui8 = spirv.Constant 0 : ui8 +spirv.func @func() -> () "None" { + %5 = spirv.Constant 0 : ui8 + spirv.Return +}