Skip to content
Commit c92c8f06 authored by Tobias Grosser's avatar Tobias Grosser
Browse files

[isl-codegen]: Fix off by one in getNumberOfIterations

We need to remove one dimension. Any is correct as long as it exists. We have
choosen for whatever reason the dimension #dims - 2. This is incorrect if
there is just one dimension. For CLooG this case did never happen. For isl
however, the case can happen and causes undefined behavior including crashes.
We choose now always the last dimension #dims - 1. We could have choosen
dimension '0' but the last dimension is what we remove conceptionally in the
algorithm, so it seems better to actually program it that way.

While at it remove another piece of undefined behavior.

llvm-svn: 174894
parent 0b8ae895
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment