1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=thumbv8m.base-none-eabi %s -o - | FileCheck %s --check-prefix=CHECK-T1
3 ; RUN: llc < %s -mtriple=thumbv8m.main-none-eabi %s -o - | FileCheck %s --check-prefix=CHECK-T2
5 define i32* @test(i32* returned %this, i32 %event_size, i8* %event_pointer) {
6 ; CHECK-T1-LABEL: test:
7 ; CHECK-T1: @ %bb.0: @ %entry
8 ; CHECK-T1-NEXT: .save {r4, lr}
9 ; CHECK-T1-NEXT: push {r4, lr}
10 ; CHECK-T1-NEXT: mov r4, r0
11 ; CHECK-T1-NEXT: movs r0, #0
12 ; CHECK-T1-NEXT: str r0, [r4, #4]
13 ; CHECK-T1-NEXT: str r0, [r4, #8]
14 ; CHECK-T1-NEXT: str r0, [r4, #12]
15 ; CHECK-T1-NEXT: str r0, [r4, #16]
16 ; CHECK-T1-NEXT: mov r0, r4
17 ; CHECK-T1-NEXT: cbz r2, .LBB0_2
18 ; CHECK-T1-NEXT: @ %bb.1: @ %if.else
19 ; CHECK-T1-NEXT: bl equeue_create_inplace
20 ; CHECK-T1-NEXT: mov r0, r4
21 ; CHECK-T1-NEXT: pop {r4, pc}
22 ; CHECK-T1-NEXT: .LBB0_2: @ %if.then
23 ; CHECK-T1-NEXT: bl equeue_create
24 ; CHECK-T1-NEXT: mov r0, r4
25 ; CHECK-T1-NEXT: pop {r4, pc}
27 ; CHECK-T2-LABEL: test:
28 ; CHECK-T2: @ %bb.0: @ %entry
29 ; CHECK-T2-NEXT: .save {r4, lr}
30 ; CHECK-T2-NEXT: push {r4, lr}
31 ; CHECK-T2-NEXT: mov r4, r0
32 ; CHECK-T2-NEXT: movs r0, #0
33 ; CHECK-T2-NEXT: strd r0, r0, [r4, #4]
34 ; CHECK-T2-NEXT: strd r0, r0, [r4, #12]
35 ; CHECK-T2-NEXT: mov r0, r4
36 ; CHECK-T2-NEXT: cbz r2, .LBB0_2
37 ; CHECK-T2-NEXT: @ %bb.1: @ %if.else
38 ; CHECK-T2-NEXT: bl equeue_create_inplace
39 ; CHECK-T2-NEXT: mov r0, r4
40 ; CHECK-T2-NEXT: pop {r4, pc}
41 ; CHECK-T2-NEXT: .LBB0_2: @ %if.then
42 ; CHECK-T2-NEXT: bl equeue_create
43 ; CHECK-T2-NEXT: mov r0, r4
44 ; CHECK-T2-NEXT: pop {r4, pc}
46 %_update = getelementptr inbounds i32, i32* %this, i32 1
47 %0 = bitcast i32* %_update to i8*
48 tail call void @llvm.memset.p0i8.i32(i8* nonnull align 4 %0, i8 0, i32 16, i1 false) #4
49 %tobool = icmp eq i8* %event_pointer, null
50 %_equeue5 = getelementptr inbounds i32, i32* %this, i32 0
51 br i1 %tobool, label %if.then, label %if.else
53 if.then: ; preds = %entry
54 %call4 = tail call i32 @equeue_create(i32* %_equeue5, i32 %event_size) #5
57 if.else: ; preds = %entry
58 %call6 = tail call i32 @equeue_create_inplace(i32* %_equeue5, i32 %event_size, i8* nonnull %event_pointer) #5
61 if.end: ; preds = %if.else, %if.then
65 declare dso_local i32 @equeue_create(i32*, i32) local_unnamed_addr #1
66 declare dso_local i32 @equeue_create_inplace(i32*, i32, i8*) local_unnamed_addr #1
67 declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #2