# Omega Calculator v1.2 (based on Omega Library 1.2, August, 2000): # # Consider the following loop. # # for (i = 0; i < 10; i++) { # # for (j = 0; j < 20; j++) { # # A[i][j] = A[i+1][j+1]; # # } # # } # # A[i][j] is the write # # A[i+1][j+1] is the read # # # Condition that a location read in an iteration is written to in a future # # iteration # # Omega's output for this is false. Which means, this dependence does not # # exist. So, this won't preclude interchange. # { [i1,j1] -> [i2,j2]: ((0 <= i1,i2 < 10) && (0 <= j1,j2 < 20)) # # iteration ranges # && ((i1 < i2) || ((i1 = i2) && (j1 < j2))) # # iteration-1 < iteration-2 # && (i1 = i2+1) && (j1 = j2+1) # # dependence exists # }; {[i1,j1] -> [i2,j2] : FALSE } # # # # Condition that a location written to in an iteration is read in a future # # iteration # # This dependence exists and Omega gives the condition for it. # { [i1,j1] -> [i2,j2]: ((0 <= i1,i2 < 10) && (0 <= j1,j2 < 20)) # # iteration ranges # && ((i1 < i2) || ((i1 = i2) && (j1 < j2))) # # iteration-1 < iteration-2 # && (i1+1 = i2) && (j1+1 = j2) # # dependence exists # }; {[i1,j1] -> [i1+1,j1+1] : 0 <= i1 <= 8 && 0 <= j1 <= 18} # # # # The above two dependences (if they exist) do not preclude interchange. # # If interchange switches the lexicographic order of the dependence (after # # interchange), then the transformation is not legal. Note that, after # # interchange the iteration space (i,j) becomes (j,i). # # # Condition that a location read in an iteration is written to in a future # # iteration, and that this dependence is preserved after interchange. # # Omega's output for this is false. (This is because the dependence did not # # exist in the original iteration space). As mentioned earlier, this # # dependence does not preclude interchange. # { [i1,j1] -> [i2,j2]: ((0 <= i1,i2 < 10) && (0 <= j1,j2 < 20)) # # iteration ranges # && ((i1 < i2) || ((i1 = i2) && (j1 < j2))) # # iteration-1 < iteration-2 # && (i1 = i2+1) && (j1 = j2+1) # # dependence exists # && ((j1 < j2) || ((j1 = j2) && (i1 < i2))) # # interchanged-iteration-1 < interchanged-iteration-2 # }; {[i1,j1] -> [i2,j2] : FALSE } # # # # Condition that a location written to in an iteration is read in a future # # iteration, and that this dependence is preserved after interchange. This # # is true and Omega gives the condition for it. Therefore, this dependence # # does not preclude interchange. # { [i1,j1] -> [i2,j2]: ((0 <= i1,i2 < 10) && (0 <= j1,j2 < 20)) # # iteration ranges # && ((i1 < i2) || ((i1 = i2) && (j1 < j2))) # # iteration-1 < iteration-2 # && (i1+1 = i2) && (j1+1 = j2) # # dependence exists # && ((j1 < j2) || ((j1 = j2) && (i1 < i2))) # # interchanged-iteration-1 < interchanged-iteration-2 # }; {[i1,j1] -> [i1+1,j1+1] : 0 <= i1 <= 8 && 0 <= j1 <= 18} # # # # # The same example, with the loop body being. # # A[i][j] = A[i+1][j-1]; # # # # # Condition that a location read in an iteration is written to in a future # # iteration # # Omega's output for this is false. Which means, this dependence does not # # exist, and does not preclude interchange. # { [i1,j1] -> [i2,j2]: ((0 <= i1,i2 < 10) && (0 <= j1,j2 < 20)) # # iteration ranges # && ((i1 < i2) || ((i1 = i2) && (j1 < j2))) # # iteration-1 < iteration-2 # && (i1 = i2+1) && (j1 = j2-1) # # dependence exists # }; {[i1,j1] -> [i2,j2] : FALSE } # # # # Condition that a location written to in an iteration is read in a future # # iteration # # This dependence exists and Omega gives the condition for it. # { [i1,j1] -> [i2,j2]: ((0 <= i1,i2 < 10) && (0 <= j1,j2 < 20)) # # iteration ranges # && ((i1 < i2) || ((i1 = i2) && (j1 < j2))) # # iteration-1 < iteration-2 # && (i1+1 = i2) && (j1-1 = j2) # # dependence exists # }; {[i1,j1] -> [i1+1,j1-1] : 0 <= i1 <= 8 && 1 <= j1 <= 19} # # # # The above two dependences (if they exist) do not preclude interchange. # # If interchange switches the lexicographic order of the dependence (after # # interchange), then the transformation is not legal. Note that, after # # interchange the iteration space (i,j) becomes (j,i). # # # Condition that a location read in an iteration is written to in a future # # iteration, and that this dependence is preserved after interchange. # # Omega's output for this is false. (This is because the dependence did not # # exist in the original iteration space). As mentioned earlier, this # # dependence does not preclude interchange. # { [i1,j1] -> [i2,j2]: ((0 <= i1,i2 < 10) && (0 <= j1,j2 < 20)) # # iteration ranges # && ((i1 < i2) || ((i1 = i2) && (j1 < j2))) # # iteration-1 < iteration-2 # && (i1 = i2+1) && (j1 = j2-1) # # dependence exists # && ((j1 < j2) || ((j1 = j2) && (i1 < i2))) # # interchanged-iteration-1 < interchanged-iteration-2 # }; {[i1,j1] -> [i2,j2] : FALSE } # # # # Condition that a location written to in an iteration is read in a future # # iteration, and that this dependence is preserved after interchange. # # Omega's output for this is false. Therefore, this dependence does # # preclude interchange. # { [i1,j1] -> [i2,j2]: ((0 <= i1,i2 < 10) && (0 <= j1,j2 < 20)) # # iteration ranges # && ((i1 < i2) || ((i1 = i2) && (j1 < j2))) # # iteration-1 < iteration-2 # && (i1+1 = i2) && (j1-1 = j2) # # dependence exists # && ((j1 < j2) || ((j1 = j2) && (i1 < i2))) # # interchanged-iteration-1 < interchanged-iteration-2 # }; {[i1,j1] -> [i2,j2] : FALSE } #