My Project
ViewOpGraph.h
Go to the documentation of this file.
1 //===- ViewOpGraph.h - View/write op graphviz graphs ------------*- C++ -*-===//
2 //
3 // Part of the MLIR Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Defines interface to produce Graphviz outputs of MLIR op within block.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_TRANSFORMS_VIEWOPGRAPH_H_
14 #define MLIR_TRANSFORMS_VIEWOPGRAPH_H_
15 
16 #include "mlir/Support/LLVM.h"
17 #include "llvm/Support/GraphWriter.h"
18 #include "llvm/Support/raw_ostream.h"
19 
20 namespace mlir {
21 class Block;
22 class ModuleOp;
23 template <typename T> class OpPassBase;
24 
27 void viewGraph(Block &block, const Twine &name, bool shortNames = false,
28  const Twine &title = "",
29  llvm::GraphProgram::Name program = llvm::GraphProgram::DOT);
30 
31 raw_ostream &writeGraph(raw_ostream &os, Block &block, bool shortNames = false,
32  const Twine &title = "");
33 
35 std::unique_ptr<OpPassBase<ModuleOp>>
36 createPrintOpGraphPass(raw_ostream &os = llvm::errs(), bool shortNames = false,
37  const Twine &title = "");
38 
39 } // end namespace mlir
40 
41 #endif // MLIR_TRANSFORMS_VIEWOPGRAPH_H_
Definition: InferTypeOpInterface.cpp:20
std::unique_ptr< OpPassBase< ModuleOp > > createPrintOpGraphPass(raw_ostream &os=llvm::errs(), bool shortNames=false, const Twine &title="")
Creates a pass to print op graphs.
Definition: ViewOpGraph.cpp:160
raw_ostream & writeGraph(raw_ostream &os, Block &block, bool shortNames=false, const Twine &title="")
Definition: ViewOpGraph.cpp:154
void viewGraph(Block &block, const Twine &name, bool shortNames=false, const Twine &title="", llvm::GraphProgram::Name program=llvm::GraphProgram::DOT)
Definition: ViewOpGraph.cpp:149