Displaying 1 result from an estimated 1 matches for "barvinok".
Did you mean:
barinek
2016 Aug 10
3
SCEV LoopTripCount
...could optimize this function:
unsigned long kernel(long w, long h, long d) {
unsigned long count = 0;
for(int i = 0; i < w; ++i)
for(int j = i; j < h; ++j)
for(int k = j; k < d; ++k)
++count;
return count;
}
into this (it might not take into account overflows, it was generated using
the barvinok library):
unsigned long kernel2(long w, long h, long d) {
return
(-1 + w >= 0 && -1 - w + h >= 0 && -1 - h + d >= 0)
? (((((2 * w - 3 * w*w + w*w*w) + 3 * w * h + -3 * w * h*h) + ((3 * w - 3 *
w*w) + 6 * w * h) * d))/6)
: (-1 + w >= 0 && -1 - w + d >= 0 &...