It turns out that with the current scev organization ReuseOrCreateCast cannot
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 21 Feb 2012 01:19:51 +0000 (01:19 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 21 Feb 2012 01:19:51 +0000 (01:19 +0000)
commit4b04578d65e38cdb5077de2498889e4a174ccdfd
tree9a20031ede8300ee539174a428bc2715715a815f
parentfd6d3217d3b577e704ff4826775b5938c23b9e73
It turns out that with the current scev organization ReuseOrCreateCast cannot
know where users will be added. Because of this, it cannot use
Builder.GetInsertPoint at all.

This patch
* removes the FIXME about adding the assert.
* adds a comment explaining hy we don't have one.
* removes a broken logic that only works for some callers and is not needed
  since r150884.
* adds an assert to caller that would have caught the bug fixed by r150884.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151015 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolutionExpander.cpp