SCEVValidator: add new parameters resulting from constant extraction
authorTobias Grosser <tobias@grosser.es>
Thu, 10 Nov 2016 06:45:28 +0000 (06:45 +0000)
committerTobias Grosser <tobias@grosser.es>
Thu, 10 Nov 2016 06:45:28 +0000 (06:45 +0000)
commit4d543d654a89047f4d08e5cbaa72c82076587aff
tree37d62a07d55e334a10ea09228bd71ba63365b629
parent0ae390abce6a12f3f334366769fb4fae9b142e5d
SCEVValidator: add new parameters resulting from constant extraction

When extracting constant expressions out of SCEVs, new parameters may be
introduced, which have not been registered before. This change scans
SCEV expressions after constant extraction again to make sure newly
introduced parameters are registered.

We may for example extract the constant '8' from the expression '((8 * ((%a *
%b) + %c)) + (-8 * %a))' and obtain the expression '(((-1 + %b) * %a) + %c)'.
The new expression has a new parameter '(-1 + %b) * %a)', which was not
registered before, but must be registered to not crash.

This closes http://llvm.org/PR30953

Reported-by: Eli Friedman <efriedma@codeaurora.org>
llvm-svn: 286430
polly/lib/Support/SCEVAffinator.cpp
polly/test/ScopInfo/extract_constant_factor_introduces_new_parameter.ll [new file with mode: 0644]