MLIR: lib/Transforms/PrintIR.cpp Source File (original) (raw)

Go to the documentation of this file.

1

2

3

4

5

6

7

8

11 #include "llvm/Support/Debug.h"

12

13 namespace mlir {

14 namespace {

15

16 #define GEN_PASS_DEF_PRINTIRPASS

17 #include "mlir/Transforms/Passes.h.inc"

18

19 struct PrintIRPass : public impl::PrintIRPassBase {

20 using impl::PrintIRPassBase::PrintIRPassBase;

21

22 void runOnOperation() override {

23 llvm::dbgs() << "// -----// IR Dump";

24 if (!this->label.empty())

25 llvm::dbgs() << " " << this->label;

26 llvm::dbgs() << " //----- //\n";

27 getOperation()->dump();

28 markAllAnalysesPreserved();

29 }

30 };

31

32 }

33

35 return std::make_unique(options);

36 }

37

38 }

static llvm::ManagedStatic< PassManagerOptions > options

Include the generated interface declarations.

std::unique_ptr< Pass > createPrintIRPass(const PrintIRPassOptions &={})

Creates a pass to print IR on the debug stream.