feat(analysis): support unit-dependent loop starts - #175
Merged
Merged
Conversation
zhen8838
force-pushed
the
feat/unit-dependent-loop-start
branch
from
September 21, 2026 12:32
ffd8f72 to
448d74c
Compare
zhen8838
commented
Sep 21, 2026
zhen8838
commented
Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
What
tile(start, stop, step)round trips.Contract
tile()accepts two arguments or(start, stop, step). Loopstartandextentmay depend on bounded unit values;stepmust be literal because Presburger arithmetic cannot represent a parametric stride.TypeInferResultswith a value range; bareTyperemains valid.RangeMetadatafollows theexpr.typelifecycle. Inference that does not write type also does not write range.TypeInferVisitorandinference_typelive invisitor_registry/typeinfer.py; verify, codegen, and cost visitors remain invisitors.py.IterationScope, construction, and traversal live inanalysis/iteration_scope.py; access resolution lives inanalysis/access.py; loop domains live inanalysis/loop_domain.py.AccessandAccessPrecisionbelong toanalysis/access.py; bounded parameters may remainEXACT.cardinalityis the sole public point-counting entry. An empty parameter context counts as0; bounded boxes up toPARAM_POINT_LIMITare enumerated; oversized or nonempty unbounded boxes returnNone.ir/isl_interop.pyowns dim/shape-to-isl interop, includingindex_set;ir/types/dim.pycontains only definitions and constructors,ir/types/dim_isl.pyis removed, andutils/isl_utils.pyremains IR-independent.dim_to_isl_expr,shape_to_isl_domain, andisl_to_dim;normalize_dimanddim_rangeretain their names.dim_rangereturnsNonewhen no bound is available; unsupported symbolic divisors still raise.analysis/loop_terms.py(formerlyaffine.py) performs HIR-to-LoopTermconversion without isl.LoopAffineTermis renamedLoopTerm.widest_allowedis public inanalysis/access.py;analysis/footprint.pyis retained as an empty placeholder for future footprint work.resolve_program_geometryandlocal_duration_nsare public analysis helpers.Expr.type; the previous specification wording claiming it did was corrected.Risk
WIDENED: loop-term binding does not support floor-div/mod.LoopTermremains a custom tuple-like representation rather than an isl object; this review intentionally only renamed it.ir.hir.specialize._record_complete_bindings, function-localir.hir.verify._verify_isolated, andir.types.shard.mesh._positions_layout. Proper fixes require public IR-side APIs, not merely removing underscores.MeshCoordevaluation is deferred to issue feat(evaluator): model the mesh so check can reference a coordinate-reading program #138.normalize_dimmay retain an invalid static object.