188 lines · plain
1; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -aarch64-neon-syntax=apple -pass-remarks-missed=regalloc 2>&1 | FileCheck -check-prefix=REMARK %s2; 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 %s3; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -aarch64-neon-syntax=apple 2>&1 | FileCheck -check-prefix=NO_REMARK %s4; 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 %s5; RUN: cat %t.yaml | FileCheck -check-prefix=YAML %s6;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 %s11; 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 %s14; RUN: cat %t.threshold.yaml | FileCheck -check-prefix=THRESHOLD_YAML %s15 16; This has two nested loops, each with one value that has to be spilled and17; then reloaded.18 19; (loop3:)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{{$}}21; (loop2:)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{{$}}23; (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{{$}}25; (func:)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{{$}}27 28; (loop3:)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)30; (loop2:)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)32; (loop:)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)34 35; NO_REMARK-NOT: remark36 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)39 40; YAML: --- !Missed41; YAML: Pass: regalloc42; YAML: Name: LoopSpillReloadCopies43; YAML: DebugLoc: { File: '/tmp/kk.c', Line: 3, Column: 20 }44; YAML: Function: fpr12845; YAML: Hotness: 30046; YAML: Args: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 loop56; YAML: ...57; YAML: --- !Missed58; YAML: Pass: regalloc59; YAML: Name: LoopSpillReloadCopies60; YAML: DebugLoc: { File: '/tmp/kk.c', Line: 2, Column: 20 }61; YAML: Function: fpr12862; YAML: Hotness: 3000063; YAML: Args: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 loop73; YAML: ...74; YAML: --- !Missed75; YAML: Pass: regalloc76; YAML: Name: LoopSpillReloadCopies77; YAML: DebugLoc: { File: '/tmp/kk.c', Line: 1, Column: 20 }78; YAML: Function: fpr12879; YAML: Hotness: 30080; YAML: Args: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 loop94; YAML: ...95; YAML: --- !Missed96; YAML: Pass: regalloc97; YAML: Name: SpillReloadCopies98; YAML: DebugLoc: { File: '/tmp/kk.c', Line: 1, Column: 1 }99; YAML: Function: fpr128100; YAML: Hotness: 3101; YAML: Args: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 function115; YAML: ...116 117; THRESHOLD_YAML-NOT: Hotness: 300{{$}}118; THRESHOLD_YAML: --- !Missed119; THRESHOLD_YAML: Pass: regalloc120; THRESHOLD_YAML: Name: LoopSpillReloadCopies121; THRESHOLD_YAML: DebugLoc: { File: '/tmp/kk.c', Line: 2, Column: 20 }122; THRESHOLD_YAML: Function: fpr128123; THRESHOLD_YAML: Hotness: 30000124; 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 loop134; THRESHOLD_YAML: ...135 136define void @fpr128(ptr %p) nounwind ssp !prof !11 !dbg !6 {137entry:138 br label %loop, !dbg !8139 140loop:141 %i = phi i32 [ 0, %entry], [ %i.2, %end2 ]142 br label %loop2, !dbg !9143 144loop2: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}"() nounwind147 %j.2 = add i32 %j, 1148 %c2 = icmp slt i32 %j.2, 100149 br i1 %c2, label %loop2, label %end2, !prof !12150 151end2: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}"() nounwind153 %i.2 = add i32 %i, 1154 %c = icmp slt i32 %i.2, 100155 br i1 %c, label %loop, label %end, !prof !12156 157end:158 br label %loop3159 160loop3: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}"() nounwind163 %k.2 = add i32 %k, 1164 %c3 = icmp slt i32 %k.2, 100165 br i1 %c3, label %loop3, label %end3, !dbg !10, !prof !12166 167end3:168 ret void169}170 171!llvm.dbg.cu = !{!0}172!llvm.module.flags = !{!3, !4}173!llvm.ident = !{!5}174 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")177!2 = !{}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}188