From: Dan Gohman Date: Thu, 5 Nov 2009 19:41:37 +0000 (+0000) Subject: Fix IVUsers to avoid assuming that the loop has a unique backedge. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a6a4aaefeea8622e022723f27b7e845997b81f64;p=oota-llvm.git Fix IVUsers to avoid assuming that the loop has a unique backedge. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86161 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/IVUsers.cpp b/lib/Analysis/IVUsers.cpp index 543e017fc9d..20b69f2a7ca 100644 --- a/lib/Analysis/IVUsers.cpp +++ b/lib/Analysis/IVUsers.cpp @@ -151,6 +151,8 @@ static bool IVUseShouldUsePostIncValue(Instruction *User, Instruction *IV, if (L->contains(User->getParent())) return false; BasicBlock *LatchBlock = L->getLoopLatch(); + if (!LatchBlock) + return false; // Ok, the user is outside of the loop. If it is dominated by the latch // block, use the post-inc value.