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

bug[next]: ConstantFolding after create_global_tmps #1756

Merged
merged 6 commits into from
Nov 30, 2024
Merged
Changes from 3 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
17 changes: 11 additions & 6 deletions src/gt4py/next/iterator/transforms/infer_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
ir_makers as im,
)
from gt4py.next.iterator.transforms import trace_shifts
from gt4py.next.iterator.transforms.constant_folding import ConstantFolding
from gt4py.next.utils import flatten_nested_tuple, tree_map


Expand Down Expand Up @@ -418,10 +419,14 @@ def infer_program(
not program.function_definitions
), "Domain propagation does not support function definitions."

return itir.Program(
id=program.id,
function_definitions=program.function_definitions,
params=program.params,
declarations=program.declarations,
body=[_infer_stmt(stmt, offset_provider, symbolic_domain_sizes) for stmt in program.body],
return ConstantFolding.apply( # type: ignore[return-value] # returns same type as input
itir.Program(
id=program.id,
function_definitions=program.function_definitions,
params=program.params,
declarations=program.declarations,
body=[
_infer_stmt(stmt, offset_provider, symbolic_domain_sizes) for stmt in program.body
],
)
)
SF-N marked this conversation as resolved.
Show resolved Hide resolved
Loading