[llvm] r271151 - [SCEV] Don't always add no-wrap flags to post-inc add recs

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Sat May 28 23:13:57 PDT 2016

On 05/29/2016 03:25 AM, Sanjoy Das wrote:
> Hi Tobias, Johannes,
> This change seems to have broken ScopInfo/wraping_signed_expr_1.ll .
> I don't understand what is being tested there to confidently fix the
> test, can one of you please take a look?

> The change above fixes a long-standing issue in SCEV where it would
> incorrectly mark an induction variable as no-overflow, so this fallout
> isn't a 100% surprising.  I haven't reverted the change yet since I've
> already checked in some dependent changes (maybe wasn't the best idea
> in hindsight) and would like to avoid unnecessary churn; but if things
> will be easier for you if I reverted please let me know and I'll
> revert.

I XFAILEd the Polly test case to stop the buildbot noise. So no revert
necessary. Thanks for letting us know immediately.

> As I understand, the difference made by r271151 is that
> %indvars.iv.next is no longer "obviously" an <nsw> add recurrence.
> But if you rotate the loop by -loop-rotate, SCEV should be able to
> prove that the add rec for %indvars.iv.next is <nsw>; so maybe the
> simplest fix is to just loop rotate both the @wrap and @nowrap
> functions.

Right. This does not impact the correctness of Polly, as we just
generate more the necessary run-time checks to handle this situation.
Hence, we likely only need to update our test cases. Let's have this
discussion in your patch review thread.


More information about the llvm-commits mailing list