File tree Expand file tree Collapse file tree 4 files changed +6
-24
lines changed
include/flang/Optimizer/Transforms Expand file tree Collapse file tree 4 files changed +6
-24
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,7 @@ std::unique_ptr<mlir::Pass> createFirToCfgPass();
42
42
// / nodes as block arguments.
43
43
std::unique_ptr<mlir::Pass> createMemToRegPass ();
44
44
45
- // / This pass will preform inlining on FIR.
46
- std::unique_ptr<mlir::Pass> createInlinerPass ();
47
-
48
- // / Is inlining enabled? Check this before instantiating the pass with
49
- // / createInlinerPass().
50
- bool inlinerIsEnabled ();
45
+ // / Support for inlining on FIR.
51
46
bool canLegallyInline (mlir::Operation *op, mlir::Region *reg,
52
47
mlir::BlockAndValueMapping &map);
53
48
Original file line number Diff line number Diff line change 13
13
#include " llvm/Support/CommandLine.h"
14
14
15
15
static llvm::cl::opt<bool >
16
- enableInliningPass ( " enable-inlining " ,
17
- llvm::cl::desc (" enable FIR inlining pass " ),
16
+ aggressivelyInline ( " inline-all " ,
17
+ llvm::cl::desc (" aggressively inline everything " ),
18
18
llvm::cl::init(false ));
19
19
20
20
// / Should we inline the callable `op` into region `reg`?
21
21
bool fir::canLegallyInline (mlir::Operation *op, mlir::Region *reg,
22
22
mlir::BlockAndValueMapping &map) {
23
- // TODO: this should _not_ just return true.
24
- return true ;
25
- }
26
-
27
- // / Should an inlining pass be instantiated?
28
- bool fir::inlinerIsEnabled () { return enableInliningPass; }
29
-
30
- // / Instantiate an inlining pass. NB: If inlining is disabled, the compiler will
31
- // / abort if an inlining pass is instantiated.
32
- std::unique_ptr<mlir::Pass> fir::createInlinerPass () {
33
- if (enableInliningPass)
34
- return mlir::createInlinerPass ();
35
- llvm::report_fatal_error (" inlining is disabled" );
23
+ return aggressivelyInline;
36
24
}
Original file line number Diff line number Diff line change 1
- // RUN: tco --enable-inlining %s -o - | FileCheck %s
1
+ // RUN: tco --inline-all %s -o - | FileCheck %s
2
2
3
3
// CHECK-LABEL: @add
4
4
func @add(%a : i32, %b : i32) -> i32 {
Original file line number Diff line number Diff line change @@ -93,8 +93,7 @@ static int compileFIR(const mlir::PassPipelineCLParser &passPipeline) {
93
93
// simplify the IR
94
94
pm.addPass (mlir::createCanonicalizerPass ());
95
95
pm.addPass (fir::createCSEPass ());
96
- if (fir::inlinerIsEnabled ())
97
- pm.addPass (fir::createInlinerPass ());
96
+ pm.addPass (mlir::createInlinerPass ());
98
97
pm.addPass (mlir::createCSEPass ());
99
98
100
99
// convert fir dialect to affine
You can’t perform that action at this time.
0 commit comments