1 ; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -aarch64-neon-syntax=apple -pass-remarks-missed=regalloc 2>&1 | FileCheck -check-prefix=REMARK %s
2 ; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -aarch64-neon-syntax=apple -pass-remarks-missed=regalloc -pass-remarks-with-hotness 2>&1 | FileCheck -check-prefix=HOTNESS %s
3 ; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -aarch64-neon-syntax=apple 2>&1 | FileCheck -check-prefix=NO_REMARK %s
4 ; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -aarch64-neon-syntax=apple -pass-remarks-output=%t.yaml -pass-remarks-with-hotness 2>&1 | FileCheck -check-prefix=NO_REMARK %s
5 ; RUN: cat %t.yaml | FileCheck -check-prefix=YAML %s
7 ; Verify that remarks below the hotness threshold are not output.
8 ; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -aarch64-neon-syntax=apple -pass-remarks-missed=regalloc \
9 ; RUN: -pass-remarks-with-hotness -pass-remarks-hotness-threshold=500 \
10 ; RUN: 2>&1 | FileCheck -check-prefix=THRESHOLD %s
11 ; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -aarch64-neon-syntax=apple -pass-remarks-output=%t.threshold.yaml \
12 ; RUN: -pass-remarks-with-hotness -pass-remarks-hotness-threshold=500 \
13 ; RUN: 2>&1 | FileCheck -check-prefix=NO_REMARK %s
14 ; RUN: cat %t.threshold.yaml | FileCheck -check-prefix=THRESHOLD_YAML %s
16 ; This has two nested loops, each with one value that has to be spilled and
20 ; REMARK: remark: /tmp/kk.c:3:20: 1 spills 1.000000e+02 total spills cost 1 reloads 1.000000e+02 total reloads cost generated in loop{{$}}
22 ; REMARK: remark: /tmp/kk.c:2:20: 1 spills 1.000000e+04 total spills cost 1 reloads 1.000000e+04 total reloads cost generated in loop{{$}}
24 ; REMARK: remark: /tmp/kk.c:1:20: 2 spills 1.010000e+04 total spills cost 2 reloads 1.010000e+04 total reloads cost 1 virtual registers copies 1.000000e+02 total copies cost generated in loop{{$}}
26 ; REMARK: remark: /tmp/kk.c:1:1: 3 spills 1.020000e+04 total spills cost 3 reloads 1.020000e+04 total reloads cost 3 virtual registers copies 1.020000e+02 total copies cost generated in function{{$}}
29 ; HOTNESS: remark: /tmp/kk.c:3:20: 1 spills 1.000000e+02 total spills cost 1 reloads 1.000000e+02 total reloads cost generated in loop (hotness: 300)
31 ; HOTNESS: remark: /tmp/kk.c:2:20: 1 spills 1.000000e+04 total spills cost 1 reloads 1.000000e+04 total reloads cost generated in loop (hotness: 30000)
33 ; HOTNESS: remark: /tmp/kk.c:1:20: 2 spills 1.010000e+04 total spills cost 2 reloads 1.010000e+04 total reloads cost 1 virtual registers copies 1.000000e+02 total copies cost generated in loop (hotness: 300)
35 ; NO_REMARK-NOT: remark
37 ; THRESHOLD-NOT: (hotness: 300)
38 ; THRESHOLD: remark: /tmp/kk.c:2:20: 1 spills 1.000000e+04 total spills cost 1 reloads 1.000000e+04 total reloads cost generated in loop (hotness: 30000)
41 ; YAML: Pass: regalloc
42 ; YAML: Name: LoopSpillReloadCopies
43 ; YAML: DebugLoc: { File: '/tmp/kk.c', Line: 3, Column: 20 }
44 ; YAML: Function: fpr128
47 ; YAML: - NumSpills: '1'
48 ; YAML: - String: ' spills '
49 ; YAML: - TotalSpillsCost: '1.000000e+02'
50 ; YAML: - String: ' total spills cost '
51 ; YAML: - NumReloads: '1'
52 ; YAML: - String: ' reloads '
53 ; YAML: - TotalReloadsCost: '1.000000e+02'
54 ; YAML: - String: ' total reloads cost '
55 ; YAML: - String: generated in loop
58 ; YAML: Pass: regalloc
59 ; YAML: Name: LoopSpillReloadCopies
60 ; YAML: DebugLoc: { File: '/tmp/kk.c', Line: 2, Column: 20 }
61 ; YAML: Function: fpr128
62 ; YAML: Hotness: 30000
64 ; YAML: - NumSpills: '1'
65 ; YAML: - String: ' spills '
66 ; YAML: - TotalSpillsCost: '1.000000e+04'
67 ; YAML: - String: ' total spills cost '
68 ; YAML: - NumReloads: '1'
69 ; YAML: - String: ' reloads '
70 ; YAML: - TotalReloadsCost: '1.000000e+04'
71 ; YAML: - String: ' total reloads cost '
72 ; YAML: - String: generated in loop
75 ; YAML: Pass: regalloc
76 ; YAML: Name: LoopSpillReloadCopies
77 ; YAML: DebugLoc: { File: '/tmp/kk.c', Line: 1, Column: 20 }
78 ; YAML: Function: fpr128
81 ; YAML: - NumSpills: '2'
82 ; YAML: - String: ' spills '
83 ; YAML: - TotalSpillsCost: '1.010000e+04'
84 ; YAML: - String: ' total spills cost '
85 ; YAML: - NumReloads: '2'
86 ; YAML: - String: ' reloads '
87 ; YAML: - TotalReloadsCost: '1.010000e+04'
88 ; YAML: - String: ' total reloads cost '
89 ; YAML: - NumVRCopies: '1'
90 ; YAML: - String: ' virtual registers copies '
91 ; YAML: - TotalCopiesCost: '1.000000e+02'
92 ; YAML: - String: ' total copies cost '
93 ; YAML: - String: generated in loop
96 ; YAML: Pass: regalloc
97 ; YAML: Name: SpillReloadCopies
98 ; YAML: DebugLoc: { File: '/tmp/kk.c', Line: 1, Column: 1 }
99 ; YAML: Function: fpr128
102 ; YAML: - NumSpills: '3'
103 ; YAML: - String: ' spills '
104 ; YAML: - TotalSpillsCost: '1.020000e+04'
105 ; YAML: - String: ' total spills cost '
106 ; YAML: - NumReloads: '3'
107 ; YAML: - String: ' reloads '
108 ; YAML: - TotalReloadsCost: '1.020000e+04'
109 ; YAML: - String: ' total reloads cost '
110 ; YAML: - NumVRCopies: '3'
111 ; YAML: - String: ' virtual registers copies '
112 ; YAML: - TotalCopiesCost: '1.020000e+02'
113 ; YAML: - String: ' total copies cost '
114 ; YAML: - String: generated in function
117 ; THRESHOLD_YAML-NOT: Hotness: 300{{$}}
118 ; THRESHOLD_YAML: --- !Missed
119 ; THRESHOLD_YAML: Pass: regalloc
120 ; THRESHOLD_YAML: Name: LoopSpillReloadCopies
121 ; THRESHOLD_YAML: DebugLoc: { File: '/tmp/kk.c', Line: 2, Column: 20 }
122 ; THRESHOLD_YAML: Function: fpr128
123 ; THRESHOLD_YAML: Hotness: 30000
124 ; THRESHOLD_YAML: Args:
125 ; THRESHOLD_YAML: - NumSpills: '1'
126 ; THRESHOLD_YAML: - String: ' spills '
127 ; THRESHOLD_YAML: - TotalSpillsCost: '1.000000e+04'
128 ; THRESHOLD_YAML: - String: ' total spills cost '
129 ; THRESHOLD_YAML: - NumReloads: '1'
130 ; THRESHOLD_YAML: - String: ' reloads '
131 ; THRESHOLD_YAML: - TotalReloadsCost: '1.000000e+04'
132 ; THRESHOLD_YAML: - String: ' total reloads cost '
133 ; THRESHOLD_YAML: - String: generated in loop
134 ; THRESHOLD_YAML: ...
136 define void @fpr128(ptr %p) nounwind ssp !prof !11 !dbg !6 {
138 br label %loop, !dbg !8
141 %i = phi i32 [ 0, %entry], [ %i.2, %end2 ]
142 br label %loop2, !dbg !9
145 %j = phi i32 [ 0, %loop], [ %j.2, %loop2 ]
146 call void asm sideeffect "; inlineasm", "~{q0},~{q1},~{q2},~{q3},~{q4},~{q5},~{q6},~{q7},~{q8},~{q9},~{q10},~{q11},~{q12},~{q13},~{q14},~{q15},~{q16},~{q17},~{q18},~{q19},~{q20},~{q21},~{q22},~{q23},~{q24},~{q25},~{q26},~{q27},~{q28},~{q29},~{q30},~{q31},~{x0},~{x1},~{x2},~{x3},~{x4},~{x5},~{x6},~{x7},~{x8},~{x9},~{x10},~{x11},~{x12},~{x13},~{x14},~{x15},~{x16},~{x17},~{x18},~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x27},~{x28},~{fp},~{lr},~{sp},~{memory}"() nounwind
148 %c2 = icmp slt i32 %j.2, 100
149 br i1 %c2, label %loop2, label %end2, !prof !12
152 call void asm sideeffect "; inlineasm", "~{q0},~{q1},~{q2},~{q3},~{q4},~{q5},~{q6},~{q7},~{q8},~{q9},~{q10},~{q11},~{q12},~{q13},~{q14},~{q15},~{q16},~{q17},~{q18},~{q19},~{q20},~{q21},~{q22},~{q23},~{q24},~{q25},~{q26},~{q27},~{q28},~{q29},~{q30},~{q31},~{x0},~{x1},~{x2},~{x3},~{x4},~{x5},~{x6},~{x7},~{x8},~{x9},~{x10},~{x11},~{x12},~{x13},~{x14},~{x15},~{x16},~{x17},~{x18},~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x27},~{x28},~{fp},~{lr},~{sp},~{memory}"() nounwind
154 %c = icmp slt i32 %i.2, 100
155 br i1 %c, label %loop, label %end, !prof !12
161 %k = phi i32 [ 0, %end], [ %k.2, %loop3 ]
162 call void asm sideeffect "; inlineasm", "~{q0},~{q1},~{q2},~{q3},~{q4},~{q5},~{q6},~{q7},~{q8},~{q9},~{q10},~{q11},~{q12},~{q13},~{q14},~{q15},~{q16},~{q17},~{q18},~{q19},~{q20},~{q21},~{q22},~{q23},~{q24},~{q25},~{q26},~{q27},~{q28},~{q29},~{q30},~{q31},~{x0},~{x1},~{x2},~{x3},~{x4},~{x5},~{x6},~{x7},~{x8},~{x9},~{x10},~{x11},~{x12},~{x13},~{x14},~{x15},~{x16},~{x17},~{x18},~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x27},~{x28},~{fp},~{lr},~{sp},~{memory}"() nounwind
164 %c3 = icmp slt i32 %k.2, 100
165 br i1 %c3, label %loop3, label %end3, !dbg !10, !prof !12
172 !llvm.module.flags = !{!3, !4}
175 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2)
176 !1 = !DIFile(filename: "/tmp/kk.c", directory: "/tmp")
178 !3 = !{i32 2, !"Debug Info Version", i32 3}
179 !4 = !{i32 1, !"PIC Level", i32 2}
180 !5 = !{!"clang version 3.9.0 "}
181 !6 = distinct !DISubprogram(name: "success", scope: !1, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !2)
182 !7 = !DISubroutineType(types: !2)
183 !8 = !DILocation(line: 1, column: 20, scope: !6)
184 !9 = !DILocation(line: 2, column: 20, scope: !6)
185 !10 = !DILocation(line: 3, column: 20, scope: !6)
186 !11 = !{!"function_entry_count", i64 3}
187 !12 = !{!"branch_weights", i32 99, i32 1}