Skip to content

Commit 3c43b33

Browse files
committed
set filter axiom
1 parent be62626 commit 3c43b33

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

thorin/pass/optimize.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ void optimize(World& world, PipelineBuilder& builder) {
1717
pipe.add<PassManPhase>(builder.opt_phase(world));
1818
pipe.add<LamSpec>();
1919
pipe.add<PassManPhase>(builder.codegen_prep_phase(world));
20+
pipe.add<PassManPhase>(builder.opt_phase2(world));
2021
pipe.run();
2122
}
2223

thorin/pass/pipelinebuilder.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ void PipelineBuilder::extend_codegen_prep_phase(std::function<void(PassMan&)> ex
2323
codegen_prep_phase_extensions_.push_back(extension);
2424
}
2525

26+
std::unique_ptr<PassMan> PipelineBuilder::opt_phase2(World& world) {
27+
auto man = std::make_unique<PassMan>(world);
28+
29+
man->add<PartialEval>();
30+
man->add<BetaRed>();
31+
auto er = man->add<EtaRed>();
32+
auto ee = man->add<EtaExp>(er);
33+
man->add<Scalerize>(ee);
34+
man->add<TailRecElim>(er);
35+
36+
return man;
37+
}
38+
2639
std::unique_ptr<PassMan> PipelineBuilder::opt_phase(World& world) {
2740
auto man = std::make_unique<PassMan>(world);
2841

thorin/pass/pipelinebuilder.h

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class PipelineBuilder {
1515
void extend_codegen_prep_phase(std::function<void(PassMan&)>);
1616

1717
std::unique_ptr<PassMan> opt_phase(World& world);
18+
std::unique_ptr<PassMan> opt_phase2(World& world);
1819
std::unique_ptr<PassMan> codegen_prep_phase(World& world);
1920

2021
private:

0 commit comments

Comments
 (0)