Reed Kotler | 0d409e2 | 2013-11-28 00:56:37 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -soft-float -mips16-hard-float -relocation-model=static -mips16-constant-islands=true < %s | FileCheck %s -check-prefix=lcb |
| 2 | |
| 3 | ; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -soft-float -mips16-hard-float -relocation-model=static -mips16-constant-islands=true < %s | FileCheck %s -check-prefix=lcbn |
| 4 | |
| 5 | @i = global i32 0, align 4 |
| 6 | @j = common global i32 0, align 4 |
| 7 | @k = common global i32 0, align 4 |
| 8 | |
| 9 | ; Function Attrs: nounwind optsize |
| 10 | define i32 @bnez() #0 { |
| 11 | entry: |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 12 | %0 = load i32, i32* @i, align 4, !tbaa !1 |
Reed Kotler | 0d409e2 | 2013-11-28 00:56:37 +0000 | [diff] [blame] | 13 | %cmp = icmp eq i32 %0, 0 |
| 14 | br i1 %cmp, label %if.then, label %if.end |
| 15 | |
| 16 | if.then: ; preds = %entry |
| 17 | tail call void asm sideeffect ".space 10000", ""() #1, !srcloc !5 |
| 18 | store i32 0, i32* @i, align 4, !tbaa !1 |
| 19 | br label %if.end |
| 20 | |
| 21 | if.end: ; preds = %if.then, %entry |
| 22 | ret i32 0 |
| 23 | } |
| 24 | ; lcb: .ent bnez |
| 25 | ; lcbn: .ent bnez |
| 26 | ; lcb: bnez ${{[0-9]+}}, $BB{{[0-9]+}}_{{[0-9]+}} |
| 27 | ; lcbn-NOT: bnez ${{[0-9]+}}, $BB{{[0-9]+}}_{{[0-9]+}} # 16 bit inst |
| 28 | ; lcb: .end bnez |
| 29 | ; lcbn: .end bnez |
| 30 | |
| 31 | ; Function Attrs: nounwind optsize |
| 32 | define i32 @beqz() #0 { |
| 33 | entry: |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 34 | %0 = load i32, i32* @i, align 4, !tbaa !1 |
Reed Kotler | 0d409e2 | 2013-11-28 00:56:37 +0000 | [diff] [blame] | 35 | %cmp = icmp eq i32 %0, 0 |
| 36 | br i1 %cmp, label %if.then, label %if.else |
| 37 | |
| 38 | if.then: ; preds = %entry |
| 39 | store i32 10, i32* @j, align 4, !tbaa !1 |
| 40 | tail call void asm sideeffect ".space 10000", ""() #1, !srcloc !6 |
| 41 | br label %if.end |
| 42 | |
| 43 | if.else: ; preds = %entry |
| 44 | store i32 55, i32* @j, align 4, !tbaa !1 |
| 45 | tail call void asm sideeffect ".space 10000", ""() #1, !srcloc !7 |
| 46 | br label %if.end |
| 47 | |
| 48 | if.end: ; preds = %if.else, %if.then |
| 49 | ret i32 0 |
| 50 | } |
| 51 | |
| 52 | ; lcb: .ent beqz |
| 53 | ; lcbn: .ent beqz |
| 54 | ; lcb: beqz ${{[0-9]+}}, $BB{{[0-9]+}}_{{[0-9]+}} |
| 55 | ; lcbn-NOT: beqz ${{[0-9]+}}, $BB{{[0-9]+}}_{{[0-9]+}} # 16 bit inst |
| 56 | ; lcb: .end beqz |
| 57 | ; lcbn: .end beqz |
| 58 | |
| 59 | |
| 60 | ; Function Attrs: nounwind optsize |
| 61 | define void @bteqz() #0 { |
| 62 | entry: |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 63 | %0 = load i32, i32* @i, align 4, !tbaa !1 |
| 64 | %1 = load i32, i32* @j, align 4, !tbaa !1 |
Reed Kotler | 0d409e2 | 2013-11-28 00:56:37 +0000 | [diff] [blame] | 65 | %cmp = icmp eq i32 %0, %1 |
| 66 | br i1 %cmp, label %if.then, label %if.else |
| 67 | |
| 68 | if.then: ; preds = %entry |
| 69 | store i32 1, i32* @k, align 4, !tbaa !1 |
| 70 | tail call void asm sideeffect ".space 1000", ""() #1, !srcloc !8 |
| 71 | br label %if.end |
| 72 | |
| 73 | if.else: ; preds = %entry |
| 74 | tail call void asm sideeffect ".space 1000", ""() #1, !srcloc !9 |
| 75 | store i32 2, i32* @k, align 4, !tbaa !1 |
| 76 | br label %if.end |
| 77 | |
| 78 | if.end: ; preds = %if.else, %if.then |
| 79 | ret void |
| 80 | } |
| 81 | |
| 82 | ; lcb: .ent bteqz |
| 83 | ; lcbn: .ent bteqz |
| 84 | ; lcb: btnez $BB{{[0-9]+}}_{{[0-9]+}} |
| 85 | ; lcbn-NOT: btnez $BB{{[0-9]+}}_{{[0-9]+}} # 16 bit inst |
| 86 | ; lcb: .end bteqz |
| 87 | ; lcbn: .end bteqz |
| 88 | |
| 89 | |
| 90 | ; Function Attrs: nounwind optsize |
| 91 | define void @btz() #0 { |
| 92 | entry: |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 93 | %0 = load i32, i32* @i, align 4, !tbaa !1 |
| 94 | %1 = load i32, i32* @j, align 4, !tbaa !1 |
Reed Kotler | 0d409e2 | 2013-11-28 00:56:37 +0000 | [diff] [blame] | 95 | %cmp1 = icmp sgt i32 %0, %1 |
| 96 | br i1 %cmp1, label %if.then, label %if.end |
| 97 | |
| 98 | if.then: ; preds = %entry, %if.then |
| 99 | tail call void asm sideeffect ".space 60000", ""() #1, !srcloc !10 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 100 | %2 = load i32, i32* @i, align 4, !tbaa !1 |
| 101 | %3 = load i32, i32* @j, align 4, !tbaa !1 |
Reed Kotler | 0d409e2 | 2013-11-28 00:56:37 +0000 | [diff] [blame] | 102 | %cmp = icmp sgt i32 %2, %3 |
| 103 | br i1 %cmp, label %if.then, label %if.end |
| 104 | |
| 105 | if.end: ; preds = %if.then, %entry |
| 106 | ret void |
| 107 | } |
| 108 | |
| 109 | ; lcb: .ent btz |
| 110 | ; lcbn: .ent btz |
| 111 | ; lcb: bteqz $BB{{[0-9]+}}_{{[0-9]+}} |
| 112 | ; lcbn-NOT: bteqz $BB{{[0-9]+}}_{{[0-9]+}} # 16 bit inst |
| 113 | ; lcb: btnez $BB{{[0-9]+}}_{{[0-9]+}} |
| 114 | ; lcbn-NOT: btnez $BB{{[0-9]+}}_{{[0-9]+}} # 16 bit inst |
| 115 | ; lcb: .end btz |
| 116 | ; lcbn: .end btz |
| 117 | |
| 118 | attributes #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" } |
| 119 | attributes #1 = { nounwind } |
| 120 | |
| 121 | !llvm.ident = !{!0} |
| 122 | |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 123 | !0 = !{!"clang version 3.5 (gitosis@dmz-portal.mips.com:clang.git ed197d08c90d82e1119774e10920e6f7a841c8ec) (gitosis@dmz-portal.mips.com:llvm.git b9235a363fa2dddb26ac01cbaed58efbc9eff392)"} |
| 124 | !1 = !{!2, !2, i64 0} |
| 125 | !2 = !{!"int", !3, i64 0} |
| 126 | !3 = !{!"omnipotent char", !4, i64 0} |
| 127 | !4 = !{!"Simple C/C++ TBAA"} |
| 128 | !5 = !{i32 59} |
| 129 | !6 = !{i32 156} |
| 130 | !7 = !{i32 210} |
| 131 | !8 = !{i32 299} |
| 132 | !9 = !{i32 340} |
| 133 | !10 = !{i32 412} |