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_movk: '1'
16 ; YAML: - INST_movz: '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(i32* %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: mov w10, #16959
33 ; CHECK-NEXT: movk w10, #15, lsl #16
34 ; CHECK-NEXT: add w0, w9, w1
35 ; CHECK-NEXT: add x9, x0, x2
36 ; CHECK-NEXT: cmp x9, x10
37 ; CHECK-NEXT: b.eq LBB0_2
38 ; CHECK-NEXT: ; %bb.1: ; %else
39 ; CHECK-NEXT: mul w10, w0, w1
40 ; CHECK-NEXT: mov w9, #10
41 ; CHECK-NEXT: mul w0, w10, w1
42 ; CHECK-NEXT: str w9, [x8]
43 ; CHECK-NEXT: LBB0_2: ; %common.ret
44 ; CHECK-NEXT: ; kill: def $w0 killed $w0 killed $x0
47 %l = load i32, i32* %ptr, !dbg !4
48 %add = add i32 %l, %x, !dbg !4
49 %add.ext = zext i32 %add to i64, !dbg !4
50 %add.64 = add i64 %add.ext, %y, !dbg !4
51 %c = icmp eq i64 %add.64, 999999, !dbg !4
52 br i1 %c, label %then, label %else, !dbg !4
58 store i32 10, i32* %ptr, !dbg !6
59 %res = mul i32 %add, %x, !dbg !6
60 %res.2 = mul i32 %res, %x, !dbg !6
61 ret i32 %res.2, !dbg !6
64 !llvm.module.flags = !{!2}
66 !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1)
67 !1 = !DIFile(filename: "arm64-instruction-mix-remarks.ll", directory: "")
68 !2 = !{i32 2, !"Debug Info Version", i32 3}
69 !3 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 5, scopeLine: 5, unit: !0)
70 !4 = distinct !DILocation(line: 10, column: 10, scope: !3)
71 !5 = distinct !DILocation(line: 20, column: 20, scope: !3)
72 !6 = distinct !DILocation(line: 30, column: 30, scope: !3)