OSDN Git Service

Merging r340900:
[android-x86/external-llvm.git] / test / Transforms / LICM / loopsink-pr38462.ll
1 ; RUN: opt -S -loop-sink < %s | FileCheck %s
2
3 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-pc-windows-msvc19.13.26128"
5
6 %struct.FontInfoData = type { i32 (...)** }
7 %struct.S = type { i8 }
8
9 ; CHECK: @pr38462
10 ; Make sure not to assert by trying to sink into catch.dispatch.
11
12 define void @pr38462(%struct.FontInfoData* %this) personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) !prof !1 {
13 entry:
14   %s = alloca %struct.S
15   %call6 = call i32 @f()
16   %tobool7 = icmp eq i32 %call6, 0
17   br i1 %tobool7, label %for.body.lr.ph, label %for.cond.cleanup
18
19 for.body.lr.ph:
20   %0 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
21   br label %for.body
22
23 for.cond.cleanup.loopexit:
24   br label %for.cond.cleanup
25
26 for.cond.cleanup:
27   ret void
28
29 for.body:
30   %call2 = invoke i32 @f() to label %__try.cont unwind label %catch.dispatch
31
32 catch.dispatch:
33   %1 = catchswitch within none [label %__except] unwind to caller
34
35 __except:
36   %2 = catchpad within %1 [i8* null]
37   catchret from %2 to label %__except3
38
39 __except3:
40   call void @llvm.lifetime.start.p0i8(i64 1, i8* nonnull %0)
41   %call.i = call zeroext i1 @g(%struct.S* nonnull %s)
42   br i1 %call.i, label %if.then.i, label %exit
43
44 if.then.i:
45   %call2.i = call i32 @f()
46   br label %exit
47
48 exit:
49   call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %0)
50   br label %__try.cont
51
52 __try.cont:
53   %call = call i32 @f()
54   %tobool = icmp eq i32 %call, 0
55   br i1 %tobool, label %for.body, label %for.cond.cleanup.loopexit
56 }
57
58 declare i32 @__C_specific_handler(...)
59 declare i32 @f()
60 declare zeroext i1 @g(%struct.S*)
61 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
62 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
63
64 !1 = !{!"function_entry_count", i64 1}
65