aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-05 04:55:35 +0000
committerChris Lattner <sabre@nondot.org>2010-01-05 04:55:35 +0000
commite04accaad3f1f2b6a65f654695cbfcdae199689c (patch)
treecc25ece030ec40877d867322ab7ddec183154ad8 /lib
parent2c9d30097bc658e73975b7786c076c10fe369984 (diff)
downloadexternal_llvm-e04accaad3f1f2b6a65f654695cbfcdae199689c.zip
external_llvm-e04accaad3f1f2b6a65f654695cbfcdae199689c.tar.gz
external_llvm-e04accaad3f1f2b6a65f654695cbfcdae199689c.tar.bz2
fix an infinite loop in reassociate building emacs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92679 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/Reassociate.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp
index 564036b..f2a8633 100644
--- a/lib/Transforms/Scalar/Reassociate.cpp
+++ b/lib/Transforms/Scalar/Reassociate.cpp
@@ -932,6 +932,10 @@ void Reassociate::ReassociateBB(BasicBlock *BB) {
if (BI->getOpcode() == Instruction::Sub) {
if (ShouldBreakUpSubtract(BI)) {
BI = BreakUpSubtract(BI, ValueRankMap);
+ // Reset the BBI iterator in case BreakUpSubtract changed the
+ // instruction it points to.
+ BBI = BI;
+ ++BBI;
MadeChange = true;
} else if (BinaryOperator::isNeg(BI)) {
// Otherwise, this is a negation. See if the operand is a multiply tree