Skip to content

Commit 0014b84

Browse files
committed
feat(//core/lowering): Adds peephole optimization pass
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent ca2b5f9 commit 0014b84

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: core/lowering/lowering.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
#include "torch/csrc/jit/passes/dead_code_elimination.h"
33
#include "torch/csrc/jit/passes/fuse_linear.h"
44
#include "torch/csrc/jit/passes/freeze_module.h"
5+
#include "torch/csrc/jit/passes/guard_elimination.h"
56
#include "torch/csrc/jit/passes/loop_unrolling.h"
67
#include "torch/csrc/jit/passes/lower_graph.h"
78
#include "torch/csrc/jit/passes/lower_tuples.h"
9+
#include "torch/csrc/jit/passes/peephole.h"
810
#include "torch/csrc/jit/passes/quantization.h"
9-
#include "torch/csrc/jit/passes/guard_elimination.h"
1011

1112
#include "core/util/prelude.h"
1213
#include "core/lowering/lowering.h"
@@ -24,6 +25,7 @@ void LowerBlock(torch::jit::Block* b) {
2425

2526
void LowerGraph(std::shared_ptr<torch::jit::Graph>& g) {
2627
torch::jit::EliminateRedundantGuards(g);
28+
torch::jit::PeepholeOptimize(g, false);
2729
passes::EliminateExceptionOrPassPattern(g);
2830
torch::jit::FuseLinear(g);
2931
torch::jit::LowerAllTuples(g);

0 commit comments

Comments
 (0)