Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass to eliminate redundant branch and overcompute #17170

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
Loading