1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -verify -iroutliner -ir-outlining-no-cost < %s | FileCheck %s
4 %swift.error = type opaque
6 define void @outlining_swifterror1(%swift.error** swifterror %err) {
7 ; CHECK-LABEL: @outlining_swifterror1(
9 ; CHECK-NEXT: [[X:%.*]] = alloca i64, align 8
10 ; CHECK-NEXT: call void @outlined_ir_func_0(i64 5, i64* [[X]], %swift.error** swifterror [[ERR:%.*]])
11 ; CHECK-NEXT: ret void
18 %casted = bitcast i64* %x to %swift.error*
19 store %swift.error* %casted, %swift.error** %err
23 define void @outlining_swifterror2(%swift.error** swifterror %err) {
24 ; CHECK-LABEL: @outlining_swifterror2(
26 ; CHECK-NEXT: [[X:%.*]] = alloca i64, align 8
27 ; CHECK-NEXT: call void @outlined_ir_func_0(i64 3, i64* [[X]], %swift.error** swifterror [[ERR:%.*]])
28 ; CHECK-NEXT: ret void
35 %casted = bitcast i64* %x to %swift.error*
36 store %swift.error* %casted, %swift.error** %err
40 ; CHECK: define internal void @outlined_ir_func_0(i64 [[ARG0:%.*]], i64* [[ARG1:%.*]], %swift.error** swifterror [[ARG2:%.*]])
41 ; CHECK: entry_to_outline:
42 ; CHECK-NEXT: [[TMP0:%.*]] = mul i64 [[ARG0]], [[ARG0]]
43 ; CHECK-NEXT: [[TMP1:%.*]] = add i64 [[TMP0]], [[TMP0]]
44 ; CHECK-NEXT: store i64 [[TMP1]], i64* [[ARG1]], align 4
45 ; CHECK-NEXT: %casted = bitcast i64* [[ARG1]] to %swift.error*
46 ; CHECK-NEXT: store %swift.error* %casted, %swift.error** [[ARG2]], align 8
47 ; CHECK-NEXT: br label %entry_after_outline.exitStub