blob: 016e895d12efc8a496eb57d102684b34ec868b51 [file] [log] [blame]
Daniel Sanders8008de52015-10-15 14:34:23 +00001; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mattr=mips16 -mattr=+soft-float -mips16-hard-float -relocation-model=static < %s | FileCheck %s -check-prefix=ci
Reed Kotler59975c22013-12-03 23:42:51 +00002
3@i = global i32 0, align 4
4@j = common global i32 0, align 4
5@k = common global i32 0, align 4
6
7; Function Attrs: nounwind optsize
8define i32 @foo() #0 {
9entry:
David Blaikiea79ac142015-02-27 21:17:42 +000010 %0 = load i32, i32* @i, align 4, !tbaa !1
Reed Kotler59975c22013-12-03 23:42:51 +000011 %cmp = icmp eq i32 %0, 0
12 br i1 %cmp, label %if.then, label %if.else
13
14if.then: ; preds = %entry
15 tail call void asm sideeffect ".space 1000", ""() #1, !srcloc !5
16 br label %if.end
17
18if.else: ; preds = %entry
19 tail call void asm sideeffect ".space 1004", ""() #1, !srcloc !6
20 br label %if.end
21
22if.end: ; preds = %if.else, %if.then
23 %storemerge = phi i32 [ 1, %if.else ], [ 0, %if.then ]
24 store i32 %storemerge, i32* @i, align 4, !tbaa !1
25 ret i32 0
26}
27
28; ci: beqz $3, $BB0_2
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000029; ci: # %bb.1: # %if.else
Reed Kotler59975c22013-12-03 23:42:51 +000030
31
32; Function Attrs: nounwind optsize
33define i32 @goo() #0 {
34entry:
David Blaikiea79ac142015-02-27 21:17:42 +000035 %0 = load i32, i32* @i, align 4, !tbaa !1
Reed Kotler59975c22013-12-03 23:42:51 +000036 %cmp = icmp eq i32 %0, 0
37 br i1 %cmp, label %if.then, label %if.else
38
39if.then: ; preds = %entry
40 tail call void asm sideeffect ".space 1000000", ""() #1, !srcloc !7
41 br label %if.end
42
43if.else: ; preds = %entry
44 tail call void asm sideeffect ".space 1000004", ""() #1, !srcloc !8
45 br label %if.end
46
47if.end: ; preds = %if.else, %if.then
48 %storemerge = phi i32 [ 1, %if.else ], [ 0, %if.then ]
49 store i32 %storemerge, i32* @i, align 4, !tbaa !1
50 ret i32 0
51}
52
53; ci: bnez $3, $BB1_1 # 16 bit inst
54; ci: jal $BB1_2 # branch
55; ci: nop
56; ci: $BB1_1: # %if.else
57
58attributes #0 = { nounwind optsize "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
59attributes #1 = { nounwind }
60
61
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000062!1 = !{!2, !2, i64 0}
63!2 = !{!"int", !3, i64 0}
64!3 = !{!"omnipotent char", !4, i64 0}
65!4 = !{!"Simple C/C++ TBAA"}
66!5 = !{i32 58}
67!6 = !{i32 108}
68!7 = !{i32 190}
69!8 = !{i32 243}