RewriteLoopBodyWithConditionConstant can end up rewriting the
authorChris Lattner <sabre@nondot.org>
Tue, 20 Apr 2010 05:09:16 +0000 (05:09 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 20 Apr 2010 05:09:16 +0000 (05:09 +0000)
commita78130c3207e59bfb2ec0b77ca3f48677685d9ae
treed3a1523f1678b87f9ac25ccb2d4ba0a1296d0c8c
parentf1cfb953375b726f999976924f95fb80db3c1c97
RewriteLoopBodyWithConditionConstant can end up rewriting the
condition we're unswitching on.  In this case, don't try to
simplify the second copy of the loop which may be dead or not,
but is probably a constant now.  This fixes PR6879

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101870 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopUnswitch.cpp
test/Transforms/LoopUnswitch/crash.ll