Skip to content

Commit

Permalink
Add lift_if_then_else pass (#3865)
Browse files Browse the repository at this point in the history
* Add LiftIfThenElse pass

* Add more comments

* Rename and refactor

* Add description for internal data structure

* Rename a test

* Minor change

* Address comments

* Improve update_for
  • Loading branch information
kevinthesun authored and zhiics committed Oct 18, 2019
1 parent fdb01cb commit 687d4a8
Show file tree
Hide file tree
Showing 4 changed files with 617 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/tvm/ir_pass.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,13 @@ Stmt LowerStorageAccessInfo(Stmt stmt);
*/
Stmt DecorateDeviceScope(Stmt stmt);

/*!
* \brief Loop invariant code motion which locates and hoists if statements.
* \param stmt The stmt to do if statement hoisting.
* \return Transformed stmt.
*/
Stmt HoistIfThenElse(Stmt stmt);

/*!
* \brief Make an user callable API LoweredFunc.
*
Expand Down
1 change: 1 addition & 0 deletions src/api/api_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,6 @@ REGISTER_PASS(VerifyGPUCode);
REGISTER_PASS(DecorateDeviceScope);
REGISTER_PASS(InstrumentBoundCheckers);
REGISTER_PASS(VerifyCompactBuffer);
REGISTER_PASS(HoistIfThenElse);
} // namespace ir
} // namespace tvm
Loading

0 comments on commit 687d4a8

Please sign in to comment.