Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=x86_64-apple-macosx < %s -verify-machineinstrs | FileCheck %s |
| 2 | ; |
| 3 | ; PR16143: MachineOperand::setIsKill(bool): Assertion |
| 4 | ; |
| 5 | ; verify-machineinstrs should ensure that DEBUG_VALUEs go before the |
| 6 | ; terminator. |
| 7 | ; |
Stephen Lin | f799e3f | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 8 | ; CHECK-LABEL: test: |
Duncan P. N. Exon Smith | 7237970 | 2015-02-19 23:48:17 +0000 | [diff] [blame] | 9 | ; CHECK: ##DEBUG_VALUE: foo:i |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 10 | %a = type { i32, i32 } |
| 11 | |
| 12 | define hidden fastcc %a* @test() #1 { |
| 13 | entry: |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 14 | %0 = icmp eq %a* undef, null, !dbg !12 |
| 15 | br i1 %0, label %"14", label %return, !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 16 | |
| 17 | "14": ; preds = %"8" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 18 | br i1 undef, label %"25", label %"21", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 19 | |
| 20 | "21": ; preds = %"14" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 21 | br i1 undef, label %may_unswitch_on.exit, label %"6.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 22 | |
| 23 | "6.i": ; preds = %"21" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 24 | br i1 undef, label %"10.i", label %may_unswitch_on.exit, !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 25 | |
| 26 | "10.i": ; preds = %"6.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 27 | br i1 undef, label %may_unswitch_on.exit, label %"12.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 28 | |
| 29 | "12.i": ; preds = %"10.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 30 | br i1 undef, label %"4.i.i", label %"3.i.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 31 | |
| 32 | "3.i.i": ; preds = %"12.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 33 | br i1 undef, label %"4.i.i", label %VEC_edge_base_index.exit.i, !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 34 | |
| 35 | "4.i.i": ; preds = %"3.i.i", %"12.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 36 | unreachable, !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 37 | |
| 38 | VEC_edge_base_index.exit.i: ; preds = %"3.i.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 39 | br i1 undef, label %may_unswitch_on.exit, label %"16.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 40 | |
| 41 | "16.i": ; preds = %VEC_edge_base_index.exit.i |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 42 | br i1 undef, label %"4.i6.i", label %"3.i5.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 43 | |
| 44 | "3.i5.i": ; preds = %"16.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 45 | br i1 undef, label %VEC_edge_base_index.exit7.i, label %"4.i6.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 46 | |
| 47 | "4.i6.i": ; preds = %"3.i5.i", %"16.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 48 | unreachable, !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 49 | |
| 50 | VEC_edge_base_index.exit7.i: ; preds = %"3.i5.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 51 | br i1 undef, label %may_unswitch_on.exit, label %"21.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 52 | |
| 53 | "21.i": ; preds = %VEC_edge_base_index.exit7.i |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 54 | br i1 undef, label %may_unswitch_on.exit, label %"23.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 55 | |
| 56 | "23.i": ; preds = %"21.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 57 | br i1 undef, label %may_unswitch_on.exit, label %"26.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 58 | |
| 59 | "26.i": ; preds = %"34.i", %"23.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 60 | %1 = icmp eq i32 undef, 9, !dbg !12 |
| 61 | br i1 %1, label %"34.i", label %"28.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 62 | |
| 63 | "28.i": ; preds = %"26.i" |
| 64 | unreachable |
| 65 | |
| 66 | "34.i": ; preds = %"26.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 67 | br i1 undef, label %"26.i", label %"36.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 68 | |
| 69 | "36.i": ; preds = %"34.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 70 | br i1 undef, label %"37.i", label %"38.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 71 | |
| 72 | "37.i": ; preds = %"36.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 73 | br label %"38.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 74 | |
| 75 | "38.i": ; preds = %"37.i", %"36.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 76 | br i1 undef, label %"39.i", label %"45.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 77 | |
| 78 | "39.i": ; preds = %"38.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 79 | br i1 undef, label %"41.i", label %may_unswitch_on.exit, !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 80 | |
| 81 | "41.i": ; preds = %"39.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 82 | br i1 undef, label %may_unswitch_on.exit, label %"42.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 83 | |
| 84 | "42.i": ; preds = %"41.i" |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 85 | br i1 undef, label %may_unswitch_on.exit, label %"44.i", !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 86 | |
| 87 | "44.i": ; preds = %"42.i" |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 88 | %2 = load %a*, %a** undef, align 8, !dbg !12 |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 89 | %3 = bitcast %a* %2 to %a*, !dbg !12 |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 90 | call void @llvm.dbg.value(metadata %a* %3, i64 0, metadata !6, metadata !DIExpression()), !dbg !12 |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 91 | br label %may_unswitch_on.exit, !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 92 | |
| 93 | "45.i": ; preds = %"38.i" |
| 94 | unreachable |
| 95 | |
| 96 | may_unswitch_on.exit: ; preds = %"44.i", %"42.i", %"41.i", %"39.i", %"23.i", %"21.i", %VEC_edge_base_index.exit7.i, %VEC_edge_base_index.exit.i, %"10.i", %"6.i", %"21" |
| 97 | %4 = phi %a* [ %3, %"44.i" ], [ null, %"6.i" ], [ null, %"10.i" ], [ null, %VEC_edge_base_index.exit7.i ], [ null, %VEC_edge_base_index.exit.i ], [ null, %"21.i" ], [ null, %"23.i" ], [ null, %"39.i" ], [ null, %"42.i" ], [ null, %"41.i" ], [ null, %"21" ] |
| 98 | br label %return |
| 99 | |
| 100 | "25": ; preds = %"14" |
| 101 | unreachable |
| 102 | |
| 103 | "return": |
| 104 | %result = phi %a* [ null, %entry ], [ %4, %may_unswitch_on.exit ] |
David Blaikie | 6800e39 | 2014-06-24 20:10:27 +0000 | [diff] [blame] | 105 | ret %a* %result, !dbg !12 |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | attributes #0 = { nounwind readnone } |
| 109 | attributes #1 = { nounwind uwtable } |
| 110 | |
Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 111 | declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 112 | |
| 113 | !llvm.dbg.cu = !{!0} |
Manman Ren | 409558f | 2013-11-22 21:49:45 +0000 | [diff] [blame] | 114 | !llvm.module.flags = !{!22} |
Andrew Trick | c66d26a | 2013-05-26 08:58:50 +0000 | [diff] [blame] | 115 | |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 116 | !0 = !DICompileUnit(language: DW_LANG_C99, producer: "Apple clang version", isOptimized: true, emissionKind: 1, file: !20, enums: !21, retainedTypes: !21, subprograms: !18, imports: null) |
| 117 | !1 = !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !20, scope: !2, type: !3, function: %a* ()* @test, variables: !19) |
| 118 | !2 = !DIFile(filename: "a.c", directory: "/private/tmp") |
| 119 | !3 = !DISubroutineType(types: !4) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 120 | !4 = !{!5} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 121 | !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame^] | 122 | !6 = !DILocalVariable(name: "i", line: 2, arg: 1, scope: !1, file: !2, type: !5) |
| 123 | !7 = !DILocalVariable(name: "c", line: 2, arg: 2, scope: !1, file: !2, type: !8) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 124 | !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !0, baseType: !9) |
| 125 | !9 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame^] | 126 | !10 = !DILocalVariable(name: "a", line: 3, scope: !11, file: !2, type: !9) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 127 | !11 = distinct !DILexicalBlock(line: 2, column: 25, file: !20, scope: !1) |
| 128 | !12 = !DILocation(line: 2, column: 13, scope: !1) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 129 | !18 = !{!1} |
| 130 | !19 = !{!6, !7, !10} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 131 | !20 = !DIFile(filename: "a.c", directory: "/private/tmp") |
Duncan P. N. Exon Smith | 988a7f8 | 2015-03-27 20:46:33 +0000 | [diff] [blame] | 132 | !21 = !{} |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 133 | !22 = !{i32 1, !"Debug Info Version", i32 3} |