[Mlir-commits] [mlir] [mlir][VectorOps] Support string literals in `vector.print` (PR #68695)

Aart Bik llvmlistbot at llvm.org
Thu Oct 19 09:44:40 PDT 2023


aartbik wrote:

Apologies for nitpicking... but, printCString belongs to the group of memref prints, defined in RunnerUtils.h. The group of methods that constitute the "small set of primitives" that are easy to port to other platforms live in CRunnerUtils.h, and are grouped together here:

//===----------------------------------------------------------------------===//
// Small runtime support library for vector.print lowering during codegen.
//===----------------------------------------------------------------------===//
extern "C" MLIR_CRUNNERUTILS_EXPORT void printI64(int64_t i);
extern "C" MLIR_CRUNNERUTILS_EXPORT void printU64(uint64_t u);
extern "C" MLIR_CRUNNERUTILS_EXPORT void printF32(float f);
extern "C" MLIR_CRUNNERUTILS_EXPORT void printF64(double d);
extern "C" MLIR_CRUNNERUTILS_EXPORT void printOpen();
extern "C" MLIR_CRUNNERUTILS_EXPORT void printClose();
extern "C" MLIR_CRUNNERUTILS_EXPORT void printComma();
extern "C" MLIR_CRUNNERUTILS_EXPORT void printNewline();

It feels like we need to add a printString(char*s) to this set (and then also the implementation at the top of CRunnerUtils.cpp).

In the big picture, I realize this may seem like too much nitpicking, but it it is much closer to the design philosophy of the vector.print support when I first added it (enabling the first actual running end-to-end MLIR tests ;-)

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


More information about the Mlir-commits mailing list