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

Jon Roelofs llvmlistbot at llvm.org
Wed May 1 10:12:33 PDT 2024


================
@@ -2477,12 +2478,18 @@ def Vector_TransposeOp :
 }
 
 def Vector_PrintOp :
-  Vector_Op<"print", []>,
+  Vector_Op<"print", [
+    PredOpTrait<
+      "`source` or `punctuation` are not set when printing strings",
+      CPred<"!getStringLiteral() || (!getSource() && getPunctuation() == PrintPunctuation::NewLine)">
----------------
jroelofs wrote:

Why isn't other punctuation allowed? It would be very useful to be able to print strings without the trailing newline.

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


More information about the Mlir-commits mailing list