|
| 1 | +; RUN: llc -mtriple=arm64-apple-ios7.0 -pass-remarks-output=%t -pass-remarks=asm-printer -o - %s | FileCheck %s |
| 2 | +; RUN: FileCheck --input-file=%t --check-prefix=YAML %s |
| 3 | + |
| 4 | +; CHECK-LABEL: %entry |
| 5 | +; CHECK-NEXT: ldr w8, [x0] |
| 6 | +; CHECK-NEXT: add w8, w8, w1 |
| 7 | +; CHECK-NEXT: cmp w8, #100 |
| 8 | +; CHECK-NEXT: b.ne LBB0_2 |
| 9 | + |
| 10 | +; YAML: Name: InstructionMix |
| 11 | +; YAML-NEXT: DebugLoc: { File: arm64-instruction-mix-remarks.ll, Line: 10, Column: 10 } |
| 12 | +; YAML-NEXT: Function: foo |
| 13 | +; YAML-NEXT: Args: |
| 14 | +; YAML: - BasicBlock: entry |
| 15 | +; YAML: - INST_ADDWrs: '1' |
| 16 | +; YAML: - INST_Bcc: '1' |
| 17 | +; YAML: - INST_LDRWui: '1' |
| 18 | +; YAML: - INST_SUBSWri: '1' |
| 19 | + |
| 20 | + |
| 21 | +; CHECK-LABEL: %then |
| 22 | +; CHECK-NEXT: mov w0, w8 |
| 23 | +; CHECK-NEXT: ret |
| 24 | + |
| 25 | +; YAML: Name: InstructionMix |
| 26 | +; YAML-NEXT: DebugLoc: { File: arm64-instruction-mix-remarks.ll, Line: 20, Column: 20 } |
| 27 | +; YAML-NEXT: Function: foo |
| 28 | +; YAML-NEXT: Args: |
| 29 | +; YAML: - BasicBlock: then |
| 30 | +; YAML: - INST_ORRWrs: '1' |
| 31 | +; YAML: - INST_RET: '1' |
| 32 | + |
| 33 | +; CHECK-LABEL: %else |
| 34 | +; CHECK-NEXT: mul w8, w8, w1 |
| 35 | +; CHECK-NEXT: mov w9, #10 |
| 36 | +; CHECK-NEXT: mul w8, w8, w1 |
| 37 | +; CHECK-NEXT: str w9, [x0] |
| 38 | +; CHECK-NEXT: mov w0, w8 |
| 39 | +; CHECK-NEXT: ret |
| 40 | + |
| 41 | +; YAML: Name: InstructionMix |
| 42 | +; YAML-NEXT: DebugLoc: { File: arm64-instruction-mix-remarks.ll, Line: 30, Column: 30 } |
| 43 | +; YAML-NEXT: Function: foo |
| 44 | +; YAML-NEXT: Args: |
| 45 | +; YAML: - BasicBlock: else |
| 46 | +; YAML: - INST_MADDWrrr: '2' |
| 47 | +; YAML: - INST_ORRWrs: '1' |
| 48 | +; YAML: - INST_RET: '1' |
| 49 | +; YAML: - INST_STRWui: '1' |
| 50 | +define i32 @foo(i32* %ptr, i32 %x) !dbg !3 { |
| 51 | +entry: |
| 52 | + %l = load i32, i32* %ptr, !dbg !4 |
| 53 | + %add = add i32 %l, %x, !dbg !4 |
| 54 | + %c = icmp eq i32 %add, 100, !dbg !4 |
| 55 | + br i1 %c, label %then, label %else, !dbg !4 |
| 56 | + |
| 57 | +then: |
| 58 | + ret i32 %add, !dbg !5 |
| 59 | + |
| 60 | +else: |
| 61 | + store i32 10, i32* %ptr, !dbg !6 |
| 62 | + %res = mul i32 %add, %x, !dbg !6 |
| 63 | + %res.2 = mul i32 %res, %x, !dbg !6 |
| 64 | + ret i32 %res.2, !dbg !6 |
| 65 | +} |
| 66 | +!llvm.dbg.cu = !{!0} |
| 67 | +!llvm.module.flags = !{!2} |
| 68 | + |
| 69 | +!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1) |
| 70 | +!1 = !DIFile(filename: "arm64-instruction-mix-remarks.ll", directory: "") |
| 71 | +!2 = !{i32 2, !"Debug Info Version", i32 3} |
| 72 | +!3 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 5, scopeLine: 5, unit: !0) |
| 73 | +!4 = distinct !DILocation(line: 10, column: 10, scope: !3) |
| 74 | +!5 = distinct !DILocation(line: 20, column: 20, scope: !3) |
| 75 | +!6 = distinct !DILocation(line: 30, column: 30, scope: !3) |
0 commit comments