llvm.org GIT mirror llvm / 41b57f5
Merge 64582 from mainline Fix PR3522. It's not safe to sink into landing pad BB's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_25@64790 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 11 years ago
2 changed file(s) with 35 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
207207 // If there are no outputs, it must have side-effects.
208208 if (SuccToSinkTo == 0)
209209 return false;
210
211 // It's not safe to sink instructions to EH landing pad. Control flow into
212 // landing pad is implicitly defined.
213 if (SuccToSinkTo->isLandingPad())
214 return false;
210215
211216 DEBUG(cerr << "Sink instr " << *MI);
212217 DEBUG(cerr << "to block " << *SuccToSinkTo);
0 ; RUN: llvm-as < %s | llc -march=x86 -stats |& not grep machine-sink
1 ; PR3522
2
3 target triple = "i386-pc-linux-gnu"
4 @.str = external constant [13 x i8] ; <[13 x i8]*> [#uses=1]
5
6 define void @_ada_c34018a() {
7 entry:
8 %0 = tail call i32 @report__ident_int(i32 90) ; [#uses=1]
9 %1 = trunc i32 %0 to i8 ; [#uses=1]
10 invoke void @__gnat_rcheck_12(i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 32) noreturn
11 to label %invcont unwind label %lpad
12
13 invcont: ; preds = %entry
14 unreachable
15
16 bb22: ; preds = %lpad
17 ret void
18
19 return: ; preds = %lpad
20 ret void
21
22 lpad: ; preds = %entry
23 %2 = icmp eq i8 %1, 90 ; [#uses=1]
24 br i1 %2, label %return, label %bb22
25 }
26
27 declare void @__gnat_rcheck_12(i8*, i32) noreturn
28
29 declare i32 @report__ident_int(i32)