[Mlir-commits] [mlir] [mlir][VectorOps] Support string literals in `vector.print` (PR #68695)
Cullen Rhodes
llvmlistbot at llvm.org
Mon May 13 23:41:07 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)">
----------------
c-rhodes wrote:
hm that's odd, I verified no newline is printed for strings yesterday and that seems to be the case, are we seeing different behaviour? The `createPrintStrCall` for `vector.print <str>` already has `addNewLine=false`
https://github.com/llvm/llvm-project/blob/4014e2e045f5160ce9cbb9562d151f540d61c0bb/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp#L1520-L1523
although for empty string it will print newline as that wont be entered.
https://github.com/llvm/llvm-project/pull/68695
More information about the Mlir-commits
mailing list