Hi, > such an epilogue is needed when the # of iterations is not known in the > compile time; it should be fairly easy to modify the unrolling not to > emit it when it is not necessary,
Agreed, that is why I was surprised to see this in my simple example. It seems to me that the whole unrolling process has been made to, on purpose, have this epilogue in place. In the case where the unrolling would be perfect (ie. there would be no epilogue), the calculation of the max bound of the unrolled version is always done to have this epilogue (if you have 4 iterations and ask to unroll twice, it will actually change the max bound to 3, therefore, having one iteration of the unrolled version and 2 iterations of the original...). I am currently looking at the code of tree_transform_and_unroll_loop to figure out how to change this and not have an epilogue in my cases. Jc