Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions include/tvm/tir/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,14 @@ TVM_DLL Pass InstrumentProfileIntrinsics();
*/
TVM_DLL Pass DefaultGPUSchedule();

/*!
* \brief This pass analyzes primfunc & eliminates branch introdued due to layout specific padding.
* It leverages from the buffer assumptions and use the information to eliminate the branch.
* \note This creates more opportunity to vectorize the code.
* \return The Pass.
*/
TVM_DLL Pass UseAssumeToReduceBranches();

} // namespace transform
} // namespace tir
} // namespace tvm
Expand Down
13 changes: 13 additions & 0 deletions python/tvm/tir/transform/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,3 +1199,16 @@ def DefaultGPUSchedule():
ret: tvm.transform.Pass
"""
return _ffi_api.DefaultGPUSchedule() # type: ignore


def UseAssumeToReduceBranches():
"""This pass attempts to eliminates layout specific pad branch by overcomputing the values
for padded region. Eliminating the branch will help to vectorize code,
and improve element wise ops performance.
Returns
-------
fpass : tvm.transform.Pass
The result pass
"""
return _ffi_api.UseAssumeToReduceBranches() # type: ignore
Loading