[Mlir-commits] [mlir] [mlir] Remove `printCString()` from RunnerUtils (PR #70197)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Oct 25 04:42:26 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-execution-engine

Author: Benjamin Maxwell (MacDue)

<details>
<summary>Changes</summary>

This is now unused and can be replaced with `printString()` from CRunnerUtils  or `vector.print str`.

---
Full diff: https://github.com/llvm/llvm-project/pull/70197.diff


3 Files Affected:

- (modified) mlir/include/mlir/ExecutionEngine/RunnerUtils.h (-1) 
- (modified) mlir/lib/ExecutionEngine/RunnerUtils.cpp (-3) 
- (removed) mlir/test/mlir-cpu-runner/print.mlir (-19) 


``````````diff
diff --git a/mlir/include/mlir/ExecutionEngine/RunnerUtils.h b/mlir/include/mlir/ExecutionEngine/RunnerUtils.h
index 56c0983e5f15b5a..f998ed53b3403b4 100644
--- a/mlir/include/mlir/ExecutionEngine/RunnerUtils.h
+++ b/mlir/include/mlir/ExecutionEngine/RunnerUtils.h
@@ -392,7 +392,6 @@ extern "C" MLIR_RUNNERUTILS_EXPORT void printMemrefF64(int64_t rank, void *ptr);
 extern "C" MLIR_RUNNERUTILS_EXPORT void printMemrefInd(int64_t rank, void *ptr);
 extern "C" MLIR_RUNNERUTILS_EXPORT void printMemrefC32(int64_t rank, void *ptr);
 extern "C" MLIR_RUNNERUTILS_EXPORT void printMemrefC64(int64_t rank, void *ptr);
-extern "C" MLIR_RUNNERUTILS_EXPORT void printCString(char *str);
 
 extern "C" MLIR_RUNNERUTILS_EXPORT void
 _mlir_ciface_printMemref0dF32(StridedMemRefType<float, 0> *m);
diff --git a/mlir/lib/ExecutionEngine/RunnerUtils.cpp b/mlir/lib/ExecutionEngine/RunnerUtils.cpp
index 4618866f68a44b7..bbfd3a6b11c2a1b 100644
--- a/mlir/lib/ExecutionEngine/RunnerUtils.cpp
+++ b/mlir/lib/ExecutionEngine/RunnerUtils.cpp
@@ -158,9 +158,6 @@ extern "C" void printMemrefC64(int64_t rank, void *ptr) {
   _mlir_ciface_printMemrefC64(&descriptor);
 }
 
-/// Deprecated. This should be unified with printString from CRunnerUtils.
-extern "C" void printCString(char *str) { fputs(str, stdout); }
-
 extern "C" void _mlir_ciface_printMemref0dF32(StridedMemRefType<float, 0> *M) {
   impl::printMemRef(*M);
 }
diff --git a/mlir/test/mlir-cpu-runner/print.mlir b/mlir/test/mlir-cpu-runner/print.mlir
deleted file mode 100644
index e36c7154f03a7b6..000000000000000
--- a/mlir/test/mlir-cpu-runner/print.mlir
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: mlir-opt %s -pass-pipeline="builtin.module(convert-func-to-llvm,reconcile-unrealized-casts)" \
-// RUN: | mlir-cpu-runner -e main -entry-point-result=void \
-// RUN:   -shared-libs=%mlir_runner_utils,%mlir_c_runner_utils \
-// RUN: | FileCheck %s
-
-
-llvm.mlir.global internal constant @str_global("String to print\0A")
-llvm.func @printCString(!llvm.ptr<i8>)
-
-func.func @main() {
-  %0 = llvm.mlir.addressof @str_global : !llvm.ptr<array<16 x i8>>
-  %1 = llvm.mlir.constant(0 : index) : i64
-  %2 = llvm.getelementptr %0[%1, %1]
-    : (!llvm.ptr<array<16 x i8>>, i64, i64) -> !llvm.ptr<i8>
-  llvm.call @printCString(%2) : (!llvm.ptr<i8>) -> ()
-  return
-}
-
-// CHECK: String to print

``````````

</details>


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


More information about the Mlir-commits mailing list