OSDN Git Service

SCEVExpander's InsertCastOfTo knows how to move existing cast
authorDan Gohman <gohman@apple.com>
Wed, 22 Apr 2009 16:11:16 +0000 (16:11 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 22 Apr 2009 16:11:16 +0000 (16:11 +0000)
commitaabb04f52714ceb271dba7da18f757a4365bb4ac
tree87f55a4ac2b1d42a6f432ee1896facefc65af46f
parent6cdc727f2d7f68734526ef078f4632798ad40791
SCEVExpander's InsertCastOfTo knows how to move existing cast
instructions in order to avoid inserting new ones. However, if
the cast instruction is the SCEVExpander's InsertPt, this
causes subsequently emitted instructions to be inserted near
the cast, and not at the location of the original insert point.
Fix this by adjusting the insert point in such cases.
This fixes PR4009.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69808 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolutionExpander.cpp
test/Transforms/IndVarSimplify/casted-argument.ll [new file with mode: 0644]