[all-commits] [llvm/llvm-project] 516ccc: [mlir] Make the split markers of splitAndProcessBu...

Ingo Müller via All-commits all-commits at lists.llvm.org
Thu Mar 14 05:56:13 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 516ccce7fa2659bf788a817eae73fa369559cc45
      https://github.com/llvm/llvm-project/commit/516ccce7fa2659bf788a817eae73fa369559cc45
  Author: Ingo Müller <ingomueller at google.com>
  Date:   2024-03-14 (Thu, 14 Mar 2024)

  Changed paths:
    M mlir/include/mlir/Support/ToolUtilities.h
    M mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
    M mlir/lib/Support/ToolUtilities.cpp
    M mlir/lib/Tools/lsp-server-support/Transport.cpp
    M mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp
    M mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
    M mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp
    M mlir/lib/Tools/mlir-translate/MlirTranslateMain.cpp
    R mlir/test/mlir-opt/nearmiss.mlir
    A mlir/test/mlir-opt/split-markers.mlir
    A mlir/test/mlir-pdll/split-markers.pdll
    A mlir/test/mlir-translate/split-markers.mlir
    M mlir/tools/mlir-pdll/mlir-pdll.cpp

  Log Message:
  -----------
  [mlir] Make the split markers of splitAndProcessBuffer configurable. (#84765)

This allows to define custom splitters, which is interesting for
non-MLIR inputs and outputs to `mlir-translate`. For example, one may
use `; -----` as a splitter of `.ll` files. The splitters are now passed
as arguments into `splitAndProcessBuffer`, the input splitter defaulting
to the previous default (`// -----`) and the output splitter defaulting
to the empty string, which also corresponds to the previous default. The
behavior of the input split marker should not change at all; however,
outputs now have one new line *more* than before if there is no splitter
(old: `insertMarkerInOutput = false`, new: `outputSplitMarker = ""`) and
one new line *less* if there is one. The value of the input splitter is
exposed as a command line options of `mlir-translate` and other tools as
an optional value to the previously existing flag `-split-input-file`,
which defaults to the default splitter if not specified; the value of
the output splitter is exposed with the new `-output-split-marker`,
which default to the empty string in `mlir-translate` and the default
splitter in the other tools. In short, the previous usage or omission of
the flags should result in previous behavior (modulo the new lines
mentioned before).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list