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

[TE][CreatePrimFunc] Fix loop carried dependency case with nested block levels #17474

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
5 changes: 5 additions & 0 deletions python/tvm/script/ir_builder/tir/ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,11 @@ def _as_range(dom: Union[ir.Range, List[PrimExpr]]) -> ir.Range:
if isinstance(dom, ir.Range):
return dom
if isinstance(dom, (list, tuple)):
from tvm.arith import Analyzer # pylint: disable=import-outside-toplevel

extent = Analyzer().simplify(dom[1] - dom[0])
if isinstance(extent, tir.IntImm):
return ir.Range.from_min_extent(dom[0], extent)
return ir.Range(dom[0], dom[1])
if hasattr(dom, "dtype"):
return ir.Range(IntImm(dom.dtype, 0), dom)
Expand Down
Loading
Loading