[Mlir-commits] [mlir] [mlir][emitc] Add EmitC index types (PR #93155)
Corentin Ferry
llvmlistbot at llvm.org
Tue May 28 01:14:19 PDT 2024
================
@@ -1570,6 +1570,10 @@ LogicalResult CppEmitter::emitType(Location loc, Type type) {
}
if (auto iType = dyn_cast<IndexType>(type))
return (os << "size_t"), success();
+ if (auto sType = dyn_cast<emitc::SizeTType>(type))
+ return (os << "size_t"), success();
+ if (auto sType = dyn_cast<emitc::SignedSizeTType>(type))
+ return (os << "ssize_t"), success();
----------------
cferry-AMD wrote:
The only requirement is that values are preserved when going back and forth between the signed and the unsigned representative for the index type (these casts are auto-inserted depending on which signedness is needed by the op). This looks possible for `intmax_t` and `uintmax_t`.
https://github.com/llvm/llvm-project/pull/93155
More information about the Mlir-commits
mailing list