Adam Nemet | aad8160 | 2016-07-15 17:23:20 +0000 | [diff] [blame] | 1 | ; Check that BFI is not computed when -pass-remarks-with-hotness is off |
| 2 | |
| 3 | ; RUN: opt -loop-distribute -S -pass-remarks-missed=loop-distribute \ |
Adam Nemet | aa3506c | 2016-07-28 23:31:12 +0000 | [diff] [blame] | 4 | ; RUN: -debug-only=block-freq,branch-prob -pass-remarks-with-hotness \ |
| 5 | ; RUN: < %s 2>&1 | FileCheck %s --check-prefix=HOTNESS |
Adam Nemet | aad8160 | 2016-07-15 17:23:20 +0000 | [diff] [blame] | 6 | ; RUN: opt -loop-distribute -S -pass-remarks-missed=loop-distribute \ |
Adam Nemet | aa3506c | 2016-07-28 23:31:12 +0000 | [diff] [blame] | 7 | ; RUN: -debug-only=block-freq,branch-prob \ |
| 8 | ; RUN: < %s 2>&1 | FileCheck %s --check-prefix=NO_HOTNESS |
Adam Nemet | aad8160 | 2016-07-15 17:23:20 +0000 | [diff] [blame] | 9 | |
Adam Nemet | b2593f7 | 2016-07-18 16:29:27 +0000 | [diff] [blame] | 10 | ; RUN: opt -passes='require<aa>,loop-distribute' -S -pass-remarks-missed=loop-distribute \ |
Adam Nemet | aa3506c | 2016-07-28 23:31:12 +0000 | [diff] [blame] | 11 | ; RUN: -debug-only=block-freq,branch-prob -pass-remarks-with-hotness \ |
| 12 | ; RUN: < %s 2>&1 | FileCheck %s --check-prefix=HOTNESS |
Adam Nemet | b2593f7 | 2016-07-18 16:29:27 +0000 | [diff] [blame] | 13 | ; RUN: opt -passes='require<aa>,loop-distribute' -S -pass-remarks-missed=loop-distribute \ |
Adam Nemet | aa3506c | 2016-07-28 23:31:12 +0000 | [diff] [blame] | 14 | ; RUN: -debug-only=block-freq,branch-prob \ |
| 15 | ; RUN: < %s 2>&1 | FileCheck %s --check-prefix=NO_HOTNESS |
Adam Nemet | b2593f7 | 2016-07-18 16:29:27 +0000 | [diff] [blame] | 16 | |
Adam Nemet | aad8160 | 2016-07-15 17:23:20 +0000 | [diff] [blame] | 17 | ; REQUIRES: asserts |
| 18 | |
Adam Nemet | aa3506c | 2016-07-28 23:31:12 +0000 | [diff] [blame] | 19 | ; HOTNESS: Branch Probability Info : forced |
Adam Nemet | aad8160 | 2016-07-15 17:23:20 +0000 | [diff] [blame] | 20 | ; HOTNESS: block-frequency: forced |
Adam Nemet | aa3506c | 2016-07-28 23:31:12 +0000 | [diff] [blame] | 21 | ; NO_HOTNESS-NOT: Branch Probability Info : forced |
Adam Nemet | aad8160 | 2016-07-15 17:23:20 +0000 | [diff] [blame] | 22 | ; NO_HOTNESS-NOT: block-frequency: forced |
| 23 | |
| 24 | ; This is the input program: |
| 25 | ; |
| 26 | ; 1 void forced (char *A, char *B, char *C, int N) { |
| 27 | ; 2 #pragma clang loop distribute(enable) |
| 28 | ; 3 for(int i = 0; i < N; i++) { |
| 29 | ; 4 A[i] = B[i] * C[i]; |
| 30 | ; 5 } |
| 31 | ; 6 } |
| 32 | |
| 33 | target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
| 34 | target triple = "x86_64-apple-macosx10.11.0" |
| 35 | |
| 36 | |
| 37 | define void @forced(i8* %A, i8* %B, i8* %C, i32 %N) !dbg !7 !prof !22 { |
| 38 | entry: |
| 39 | %cmp12 = icmp sgt i32 %N, 0, !dbg !9 |
| 40 | br i1 %cmp12, label %ph, label %for.cond.cleanup, !dbg !10, !prof !23 |
| 41 | |
| 42 | ph: |
| 43 | br label %for.body |
| 44 | |
| 45 | for.body: |
| 46 | %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %ph ] |
| 47 | %arrayidx = getelementptr inbounds i8, i8* %B, i64 %indvars.iv, !dbg !12 |
| 48 | %0 = load i8, i8* %arrayidx, align 1, !dbg !12, !tbaa !13 |
| 49 | %arrayidx2 = getelementptr inbounds i8, i8* %C, i64 %indvars.iv, !dbg !16 |
| 50 | %1 = load i8, i8* %arrayidx2, align 1, !dbg !16, !tbaa !13 |
| 51 | %mul = mul i8 %1, %0, !dbg !17 |
| 52 | %arrayidx6 = getelementptr inbounds i8, i8* %A, i64 %indvars.iv, !dbg !18 |
| 53 | store i8 %mul, i8* %arrayidx6, align 1, !dbg !19, !tbaa !13 |
| 54 | %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1, !dbg !10 |
| 55 | %lftr.wideiv = trunc i64 %indvars.iv.next to i32, !dbg !10 |
| 56 | %exitcond = icmp eq i32 %lftr.wideiv, %N, !dbg !10 |
| 57 | br i1 %exitcond, label %for.cond.cleanup, label %for.body, !dbg !10, !llvm.loop !20, !prof !24 |
| 58 | |
| 59 | for.cond.cleanup: |
| 60 | ret void, !dbg !11 |
| 61 | } |
| 62 | |
| 63 | !llvm.dbg.cu = !{!0} |
| 64 | !llvm.module.flags = !{!3, !4} |
| 65 | |
| 66 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 267633) (llvm/trunk 267675)", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2) |
| 67 | !1 = !DIFile(filename: "/tmp/t.c", directory: "/tmp") |
| 68 | !2 = !{} |
| 69 | !3 = !{i32 2, !"Dwarf Version", i32 2} |
| 70 | !4 = !{i32 2, !"Debug Info Version", i32 3} |
| 71 | !7 = distinct !DISubprogram(name: "forced", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2) |
| 72 | !8 = !DISubroutineType(types: !2) |
| 73 | !9 = !DILocation(line: 3, column: 20, scope: !7) |
| 74 | !10 = !DILocation(line: 3, column: 3, scope: !7) |
| 75 | !11 = !DILocation(line: 6, column: 1, scope: !7) |
| 76 | !12 = !DILocation(line: 4, column: 12, scope: !7) |
| 77 | !13 = !{!14, !14, i64 0} |
| 78 | !14 = !{!"omnipotent char", !15, i64 0} |
| 79 | !15 = !{!"Simple C/C++ TBAA"} |
| 80 | !16 = !DILocation(line: 4, column: 19, scope: !7) |
| 81 | !17 = !DILocation(line: 4, column: 17, scope: !7) |
| 82 | !18 = !DILocation(line: 4, column: 5, scope: !7) |
| 83 | !19 = !DILocation(line: 4, column: 10, scope: !7) |
| 84 | !20 = distinct !{!20, !21} |
| 85 | !21 = !{!"llvm.loop.distribute.enable", i1 true} |
| 86 | !22 = !{!"function_entry_count", i64 3} |
| 87 | !23 = !{!"branch_weights", i32 99, i32 1} |
| 88 | !24 = !{!"branch_weights", i32 1, i32 99} |