[polly] handle loops using unsigned induction variables

Tobias Grosser tobias.grosser at ens.fr
Tue Apr 23 10:51:58 PDT 2013


On Tue, 2013-04-23 at 10:46 -0500, Sebastian Pop wrote:
> Hi Tobi,
> 
> Here is a patch that makes polly handle a large set of loops using unsigned
> induction variables. These were not handled previously because polly is not able
> (yet) to reason about wrap-around of unsigned types.  The patch moves the
> detection of loop exit conditions before the checks for other unsigned branches,
> letting all the loops using an unsigned induction variable to be handled by the
> SCEV trip count analysis.
> 
> I understand that this is a short-cut, and an important one to allow polly to
> handle a large class of loops.  A longer term solution would be to not use the
> SCEV trip count, and handle the loop exit conditions as extra constraints (as
> Tobi proposed in another thread).
> 
> Until we get there, is the attached patch ok to commit?

No, unfortunately.

You should try a test case which has actual computations in the loop
latch as well as a negative value in the comparison (This would probably
fail).

If you want to play with unsigned computations you probably can add a
flag to the scop detection that allows them, but please turn it off by
default.

Cheers,
Tobias




More information about the llvm-commits mailing list