llvm.org GIT mirror llvm / 5f94af0
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 Chris Lattner 9 years ago
2 changed file(s) with 19 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
931931 if (BI->getOpcode() == Instruction::Sub) {
932932 if (ShouldBreakUpSubtract(BI)) {
933933 BI = BreakUpSubtract(BI, ValueRankMap);
934 // Reset the BBI iterator in case BreakUpSubtract changed the
935 // instruction it points to.
936 BBI = BI;
937 ++BBI;
934938 MadeChange = true;
935939 } else if (BinaryOperator::isNeg(BI)) {
936940 // Otherwise, this is a negation. See if the operand is a multiply tree
0 ; RUN: opt -reassociate -disable-output %s
1
2
3 ; rdar://7507855
4 define fastcc i32 @test() nounwind {
5 entry:
6 %cond = select i1 undef, i32 1, i32 -1 ; [#uses=2]
7 br label %for.cond
8
9 for.cond: ; preds = %for.body, %entry
10 %sub889 = sub i32 undef, undef ; [#uses=1]
11 %sub891 = sub i32 %sub889, %cond ; [#uses=0]
12 %add896 = sub i32 0, %cond ; [#uses=0]
13 ret i32 undef
14 }