[Polly] Don't crash on invalid delinearization result.
authorEli Friedman <efriedma@quicinc.com>
Tue, 14 May 2019 21:32:54 +0000 (21:32 +0000)
committerEli Friedman <efriedma@quicinc.com>
Tue, 14 May 2019 21:32:54 +0000 (21:32 +0000)
commit9b234b388d34b39232943c57e7c79bc9313f50d1
treed57377307d2a5a7e3c198a06f1cef795014704db
parent0cdd3b1d817a8c366e10a1240589dd641b30b9bb
[Polly] Don't crash on invalid delinearization result.

In certain cases, it's possible for delinearization to decide one of the
array dimensions should be some function of an induction variable inside
the scop.  Make sure if this happens, we refuse to use those dimensions
for delinearization.

Usually, we end up rejecting the scop before it actually crashes, but it
looks like it's possible to slip past other checks in certain cases
involving smax expressions.

Fixes a crash that started showing up this week on the polly AOSP
builder.  As far as I can tell, this is a longstanding issue, though;
it was just exposed by better SCEV analysis of smin expressions.

Differential Revision: https://reviews.llvm.org/D61807

llvm-svn: 360708
polly/lib/Analysis/ScopDetection.cpp
polly/test/ScopInfo/multidim_invalid_dimension.ll [new file with mode: 0644]