On Fri, Sep 29, 2017 at 6:17 AM, Richard Biener <rguent...@suse.de> wrote: > I fixed the "hack patch" somewhat but realized it's not really possible > ATM to get back at this form because the array descriptor contains only > information to generate the linearized form. So while I get now correct > values they end up with runtime divisions which aren't handled by > SCEV.
You are right, SCEV has some limits on representing and folding those division expressions. There is a proposal in LLVM from Johannes Doerfert https://reviews.llvm.org/D38255 to use isl as a representation and expression folder instead of the chains of recurrences for the scalar evolution analysis. isl would be able to handle some of the semantics of the div_exprs, and the semantics of wrap-around variables, and of course it would have some other limits to represent multiplications (as we spoke about yesterday, i * N or M * N for example,) and thus that polyhedral analysis would need to rely on the delinearization of array indices.