OSDN Git Service

[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)
commita8709f19fbfdd7f182942ecaec2dd2756c88cbdb
treecaad3c21a127da77ed2a151b4089b0cd2bd02099
parent73370761f5a7e4683c93ca98eae11213c6cdf3af
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341516 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/IndVarSimplify.cpp