Skip to content
  • Matt Wala's avatar
    Improve generation of loop bounds for sequential loops by generating · 957948fa
    Matt Wala authored
    non-static loop bounds.
    
    This is intended to help the case when one loop's bounds depend on
    another loop, such as the domain
    
    { [i,j]: 0 <= i <= n and i <= j <= i }
    
    In this case we want the generated code to look like
    
        for (i = 1; i <= n; ++i)
            for (j = i; j <= i; ++i)
                ...
    
    rather than "for (j = 1; j <= n; ++j)" which are the static loop
    bounds for j.
    
    Additional changes that help realize this are as follows:
    
    * Enable code generation of piecewise affine loop bounds, so that
    piecewise affine constraints on the "j" loop may be expressed as
    conditional expressions.
    
    * Additionally, if "i" is marked local-parallel, we allow the "j" loop
    bounds to depend on "i" as long as there are no barriers inside the
    "j" loop.
    957948fa