From f6249261a9467cb93c4ccf5ae24798e2977db5a0 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 12 Feb 2005 03:26:49 +0000 Subject: [PATCH] Fix for testcase Transforms/IndVarsSimplify/2005-02-11-InvokeCrash.ll and PR504. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20129 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/IndVarSimplify.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 7ad8ef403c8..bc867029569 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -133,6 +133,8 @@ namespace { if ((*UI)->getType() == Ty) if (CastInst *CI = dyn_cast(cast(*UI))) { BasicBlock::iterator It = I; ++It; + if (isa(I)) + It = cast(I)->getNormalDest()->begin(); while (isa(It)) ++It; if (It != BasicBlock::iterator(CI)) { // Splice the cast immediately after the operand in question. -- 2.34.1