1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=arm64-apple-ios7.0 | FileCheck %s
4 ; RUN: llc -mtriple=arm64-apple-ios7.0 -pass-remarks-output=%t -pass-remarks=asm-printer -o - %s
5 ; RUN: FileCheck --input-file=%t --check-prefix=YAML %s
7 ; YAML: Name: InstructionMix
8 ; YAML-NEXT: DebugLoc: { File: arm64-instruction-mix-remarks.ll, Line: 10, Column: 10 }
9 ; YAML-NEXT: Function: foo
11 ; YAML: - BasicBlock: entry
12 ; YAML: - INST_add: '2'
13 ; YAML: - INST_b.: '1'
14 ; YAML: - INST_ldr: '1'
15 ; YAML: - INST_orr: '1'
16 ; YAML: - INST_sub: '1'
17 ; YAML: - INST_subs: '1'
19 ; YAML: Name: InstructionMix
20 ; YAML-NEXT: DebugLoc: { File: arm64-instruction-mix-remarks.ll, Line: 30, Column: 30 }
21 ; YAML-NEXT: Function: foo
23 ; YAML: - BasicBlock: else
24 ; YAML: - INST_madd: '2'
25 ; YAML: - INST_movz: '1'
26 ; YAML: - INST_str: '1'
27 define i32 @foo(ptr %ptr, i32 %x, i64 %y) !dbg !3 {
29 ; CHECK: ; %bb.0: ; %entry
30 ; CHECK-NEXT: ldr w9, [x0]
31 ; CHECK-NEXT: mov x8, x0
32 ; CHECK-NEXT: add w0, w9, w1
33 ; CHECK-NEXT: add x9, x0, x2
34 ; CHECK-NEXT: sub x9, x9, #244, lsl #12 ; =999424
35 ; CHECK-NEXT: cmp x9, #575
36 ; CHECK-NEXT: b.eq LBB0_2
37 ; CHECK-NEXT: ; %bb.1: ; %else
38 ; CHECK-NEXT: mul w9, w0, w1
39 ; CHECK-NEXT: mul w0, w9, w1
40 ; CHECK-NEXT: mov w9, #10 ; =0xa
41 ; CHECK-NEXT: str w9, [x8]
42 ; CHECK-NEXT: LBB0_2: ; %common.ret
43 ; CHECK-NEXT: ; kill: def $w0 killed $w0 killed $x0
46 %l = load i32, ptr %ptr, !dbg !4
47 %add = add i32 %l, %x, !dbg !4
48 %add.ext = zext i32 %add to i64, !dbg !4
49 %add.64 = add i64 %add.ext, %y, !dbg !4
50 %c = icmp eq i64 %add.64, 999999, !dbg !4
51 br i1 %c, label %then, label %else, !dbg !4
57 store i32 10, ptr %ptr, !dbg !6
58 %res = mul i32 %add, %x, !dbg !6
59 %res.2 = mul i32 %res, %x, !dbg !6
60 ret i32 %res.2, !dbg !6
63 !llvm.module.flags = !{!2}
65 !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1)
66 !1 = !DIFile(filename: "arm64-instruction-mix-remarks.ll", directory: "")
67 !2 = !{i32 2, !"Debug Info Version", i32 3}
68 !3 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 5, scopeLine: 5, unit: !0)
69 !4 = distinct !DILocation(line: 10, column: 10, scope: !3)
70 !5 = distinct !DILocation(line: 20, column: 20, scope: !3)
71 !6 = distinct !DILocation(line: 30, column: 30, scope: !3)