llvm.org GIT mirror llvm / 0ab6eba
Merging r323515: ------------------------------------------------------------------------ r323515 | fhahn | 2018-01-26 11:36:50 +0100 (Fri, 26 Jan 2018) | 7 lines [CallSiteSplitting] Fix infinite loop when recording conditions. Fix infinite loop when recording conditions by correctly marking basic blocks as visited. Fixes https://bugs.llvm.org/show_bug.cgi?id=36105 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@323771 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 1 year, 7 months ago
2 changed file(s) with 26 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
141141 recordCondition(CS, Pred, CS.getInstruction()->getParent(), Conditions);
142142 BasicBlock *From = Pred;
143143 BasicBlock *To = Pred;
144 SmallPtrSet Visited = {From};
144 SmallPtrSet Visited;
145145 while (!Visited.count(From->getSinglePredecessor()) &&
146146 (From = From->getSinglePredecessor())) {
147147 recordCondition(CS, From, To, Conditions);
148 Visited.insert(From);
148149 To = From;
149150 }
150151 }
1515 %r = call i32 @callee(i32* %a, i32 %v, i32 %p)
1616 ret i32 %r
1717 }
18
19 define void @fn1(i16 %p1) {
20 entry:
21 ret void
22 }
23
24 define void @fn2() {
25 ret void
26
27 ; Unreachable code below
28
29 for.inc: ; preds = %for.inc
30 br i1 undef, label %for.end6, label %for.inc
31
32 for.end6: ; preds = %for.inc
33 br i1 undef, label %lor.rhs, label %lor.end
34
35 lor.rhs: ; preds = %for.end6
36 br label %lor.end
37
38 lor.end: ; preds = %for.end6, %lor.rhs
39 call void @fn1(i16 0)
40 ret void
41 }