[mlir] support unsigned int in mlir::spirv::ConstantOp::getAsmResultNames

Fixes #60184  https://github.com/llvm/llvm-project/issues/60184

Differential Revision: https://reviews.llvm.org/D142295
This commit is contained in:
Xiang Li 2023-01-21 22:24:41 -05:00
parent fcef706363
commit 365ce62df2
2 changed files with 10 additions and 0 deletions

View File

@ -2124,6 +2124,8 @@ void mlir::spirv::ConstantOp::getAsmResultNames(
if (intTy.isSignless()) {
specialName << intCst.getInt();
} else if (intTy.isUnsigned()) {
specialName << intCst.getUInt();
} else {
specialName << intCst.getSInt();
}

View File

@ -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
}