Fix a regression for r259736.
authorWei Mi <wmi@google.com>
Thu, 4 Feb 2016 19:17:33 +0000 (19:17 +0000)
committerWei Mi <wmi@google.com>
Thu, 4 Feb 2016 19:17:33 +0000 (19:17 +0000)
commit33e7bc00293cad9c4e4fe85d74fbd085c487dfc0
tree9ceaa20ddca79e82c406d3c438afc43073c7acf8
parentb56be389c8565ba588d5580a9f9f0622829cb12f
Fix a regression for r259736.

When SCEV expansion tries to reuse an existing value, it is needed to ensure
that using the Value at the InsertPt will not break LCSSA. The fix adds a
check that InsertPt is either inside the candidate Value's parent loop, or
the candidate Value's parent loop is nullptr.

llvm-svn: 259815
llvm/lib/Analysis/ScalarEvolutionExpander.cpp