MLIR
23.0.0git
lib
Transforms
PrintIR.cpp
Go to the documentation of this file.
1
//===- PrintIR.cpp - Pass to dump IR on debug stream ----------------------===//
2
//
3
// Part of the LLVM 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
#include "
mlir/Pass/Pass.h
"
10
#include "
mlir/Transforms/Passes.h
"
11
#include "llvm/Support/Debug.h"
12
13
namespace
mlir
{
14
#define GEN_PASS_DEF_PRINTIRPASS
15
#include "mlir/Transforms/Passes.h.inc"
16
}
// namespace mlir
17
18
namespace
mlir
{
19
namespace
{
20
21
struct
PrintIRPass :
public
impl::PrintIRPassBase
<PrintIRPass> {
22
using
impl::PrintIRPassBase<PrintIRPass>::PrintIRPassBase;
23
24
void
runOnOperation()
override
{
25
llvm::dbgs() <<
"// -----// IR Dump"
;
26
if
(!this->label.empty())
27
llvm::dbgs() <<
" "
<< this->label;
28
llvm::dbgs() <<
" //----- //\n"
;
29
getOperation()->dump();
30
markAllAnalysesPreserved();
31
}
32
};
33
34
}
// namespace
35
36
}
// namespace mlir
Passes.h
mlir::impl::PrintIRPassBase
Definition
PrintIR.cpp:1058
Pass.h
mlir
Include the generated interface declarations.
Definition
AliasAnalysis.h:19
Generated on
for MLIR by
1.14.0