llvm.org GIT mirror llvm / 68438c1
Merge 81187 from mainline. fix PR4767, a crash because fp stackifier visited blocks in depth first order, so it wouldn't process unreachable blocks. When compiling at -O0, late dead block elimination isn't done and the bad instructions got to isel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_26@81268 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 10 years ago
2 changed file(s) with 38 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
212212 I != E; ++I)
213213 Changed |= processBasicBlock(MF, **I);
214214
215 // Process any unreachable blocks in arbitrary order now.
216 if (MF.size() == Processed.size())
217 return Changed;
218
219 for (MachineFunction::iterator BB = MF.begin(), E = MF.end(); BB != E; ++BB)
220 if (Processed.insert(BB))
221 Changed |= processBasicBlock(MF, *BB);
222
215223 return Changed;
216224 }
217225
0 ; RUN: llc %s -O0 -fast-isel -regalloc=local -o -
1 ; PR4767
2
3 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
4 target triple = "i386-apple-darwin10"
5
6 define void @fn(x86_fp80 %x) nounwind ssp {
7 entry:
8 %x.addr = alloca x86_fp80 ; [#uses=5]
9 store x86_fp80 %x, x86_fp80* %x.addr
10 br i1 false, label %cond.true, label %cond.false
11
12 cond.true: ; preds = %entry
13 %tmp = load x86_fp80* %x.addr ; [#uses=1]
14 %tmp1 = load x86_fp80* %x.addr ; [#uses=1]
15 %cmp = fcmp oeq x86_fp80 %tmp, %tmp1 ; [#uses=1]
16 br i1 %cmp, label %if.then, label %if.end
17
18 cond.false: ; preds = %entry
19 %tmp2 = load x86_fp80* %x.addr ; [#uses=1]
20 %tmp3 = load x86_fp80* %x.addr ; [#uses=1]
21 %cmp4 = fcmp une x86_fp80 %tmp2, %tmp3 ; [#uses=1]
22 br i1 %cmp4, label %if.then, label %if.end
23
24 if.then: ; preds = %cond.false, %cond.true
25 br label %if.end
26
27 if.end: ; preds = %if.then, %cond.false, %cond.true
28 ret void
29 }