[IndVars] Turn isValidRewrite into an assertion
authorMax Kazantsev <max.kazantsev@azul.com>
Thu, 6 Sep 2018 05:21:25 +0000 (05:21 +0000)
committerMax Kazantsev <max.kazantsev@azul.com>
Thu, 6 Sep 2018 05:21:25 +0000 (05:21 +0000)
commit51690c4f52a35e1008eaeb4e90a121fa3a6dc647
treee5522124e109bbdc55f63ad7478ef85a169bfcb9
parenteb410f79b39e73a2a2fb3eedbbf1da15aabb9f10
[IndVars] Turn isValidRewrite into an assertion

Function rewriteLoopExitValues contains a check on isValidRewrite which
is needed to make sure that SCEV does not convert the pattern
`gep Base, (&p[n] - &p[0])` into `gep &p[n], Base - &p[0]`. This problem
has been fixed in SCEV long ago, so this check is just obsolete.

This patch converts it into an assertion to make sure that the SCEV will
not mess up this case in the future.

Differential Revision: https://reviews.llvm.org/D51582
Reviewed By: atrick

llvm-svn: 341516
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp