diff options
Diffstat (limited to 'test/Transforms/SampleProfile')
-rw-r--r-- | test/Transforms/SampleProfile/branch.ll | 64 | ||||
-rw-r--r-- | test/Transforms/SampleProfile/calls.ll | 40 | ||||
-rw-r--r-- | test/Transforms/SampleProfile/discriminator.ll | 30 | ||||
-rw-r--r-- | test/Transforms/SampleProfile/fnptr.ll | 16 | ||||
-rw-r--r-- | test/Transforms/SampleProfile/propagate.ll | 98 |
5 files changed, 124 insertions, 124 deletions
diff --git a/test/Transforms/SampleProfile/branch.ll b/test/Transforms/SampleProfile/branch.ll index 6391fc5..a2d1fc3 100644 --- a/test/Transforms/SampleProfile/branch.ll +++ b/test/Transforms/SampleProfile/branch.ll @@ -32,18 +32,18 @@ define i32 @main(i32 %argc, i8** nocapture readonly %argv) #0 { ; CHECK: Printing analysis 'Branch Probability Analysis' for function 'main': entry: - tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !13, metadata !{}), !dbg !27 - tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !14, metadata !{}), !dbg !27 + tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !13, metadata !MDExpression()), !dbg !27 + tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !14, metadata !MDExpression()), !dbg !27 %cmp = icmp slt i32 %argc, 2, !dbg !28 br i1 %cmp, label %return, label %if.end, !dbg !28 ; CHECK: edge entry -> return probability is 1 / 2 = 50% ; CHECK: edge entry -> if.end probability is 1 / 2 = 50% if.end: ; preds = %entry - %arrayidx = getelementptr inbounds i8** %argv, i64 1, !dbg !30 - %0 = load i8** %arrayidx, align 8, !dbg !30, !tbaa !31 + %arrayidx = getelementptr inbounds i8*, i8** %argv, i64 1, !dbg !30 + %0 = load i8*, i8** %arrayidx, align 8, !dbg !30, !tbaa !31 %call = tail call i32 @atoi(i8* %0) #4, !dbg !30 - tail call void @llvm.dbg.value(metadata i32 %call, i64 0, metadata !17, metadata !{}), !dbg !30 + tail call void @llvm.dbg.value(metadata i32 %call, i64 0, metadata !17, metadata !MDExpression()), !dbg !30 %cmp1 = icmp sgt i32 %call, 100, !dbg !35 br i1 %cmp1, label %for.body, label %if.end6, !dbg !35 ; CHECK: edge if.end -> for.body probability is 1 / 2 = 50% @@ -55,14 +55,14 @@ for.body: ; preds = %if.end, %for.body %add = fadd double %s.015, 3.049000e+00, !dbg !36 %conv = sitofp i32 %u.016 to double, !dbg !36 %add4 = fadd double %add, %conv, !dbg !36 - tail call void @llvm.dbg.value(metadata double %add4, i64 0, metadata !18, metadata !{}), !dbg !36 + tail call void @llvm.dbg.value(metadata double %add4, i64 0, metadata !18, metadata !MDExpression()), !dbg !36 %div = fdiv double 3.940000e+00, %s.015, !dbg !37 %mul = fmul double %div, 3.200000e-01, !dbg !37 %add5 = fadd double %add4, %mul, !dbg !37 %sub = fsub double %add4, %add5, !dbg !37 - tail call void @llvm.dbg.value(metadata double %sub, i64 0, metadata !18, metadata !{}), !dbg !37 + tail call void @llvm.dbg.value(metadata double %sub, i64 0, metadata !18, metadata !MDExpression()), !dbg !37 %inc = add nsw i32 %u.016, 1, !dbg !38 - tail call void @llvm.dbg.value(metadata i32 %inc, i64 0, metadata !21, metadata !{}), !dbg !38 + tail call void @llvm.dbg.value(metadata i32 %inc, i64 0, metadata !21, metadata !MDExpression()), !dbg !38 %exitcond = icmp eq i32 %inc, %call, !dbg !38 br i1 %exitcond, label %if.end6, label %for.body, !dbg !38 ; CHECK: edge for.body -> if.end6 probability is 1 / 10227 = 0.00977804 @@ -70,7 +70,7 @@ for.body: ; preds = %if.end, %for.body if.end6: ; preds = %for.body, %if.end %result.0 = phi double [ 0.000000e+00, %if.end ], [ %sub, %for.body ] - %call7 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i64 0, i64 0), double %result.0), !dbg !39 + %call7 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %result.0), !dbg !39 br label %return, !dbg !40 ; CHECK: edge if.end6 -> return probability is 16 / 16 = 100% [HOT edge] @@ -98,36 +98,36 @@ attributes #4 = { nounwind readonly } !llvm.module.flags = !{!25, !42} !llvm.ident = !{!26} -!0 = !{!"0x11\004\00clang version 3.4 (trunk 192896) (llvm/trunk 192895)\001\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [./branch.cc] [DW_LANG_C_plus_plus] -!1 = !{!"branch.cc", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 192896) (llvm/trunk 192895)", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "branch.cc", directory: ".") !2 = !{i32 0} !3 = !{!4} -!4 = !{!"0x2e\00main\00main\00\004\000\001\000\006\00256\001\004", !1, !5, !6, null, i32 (i32, i8**)* @main, null, null, !12} ; [ DW_TAG_subprogram ] [line 4] [def] [main] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [./branch.cc] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "main", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !1, scope: !5, type: !6, function: i32 (i32, i8**)* @main, variables: !12) +!5 = !MDFile(filename: "branch.cc", directory: ".") +!6 = !MDSubroutineType(types: !7) !7 = !{!8, !8, !9} -!8 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed] -!9 = !{!"0xf\00\000\0064\0064\000\000", null, null, !10} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ] -!10 = !{!"0xf\00\000\0064\0064\000\000", null, null, !11} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from char] -!11 = !{!"0x24\00char\000\008\008\000\000\006", null, null} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char] +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !10) +!10 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11) +!11 = !MDBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) !12 = !{!13, !14, !15, !17, !18, !21, !23} -!13 = !{!"0x101\00argc\0016777220\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [argc] [line 4] -!14 = !{!"0x101\00argv\0033554436\000", !4, !5, !9} ; [ DW_TAG_arg_variable ] [argv] [line 4] -!15 = !{!"0x100\00result\007\000", !4, !5, !16} ; [ DW_TAG_auto_variable ] [result] [line 7] -!16 = !{!"0x24\00double\000\0064\0064\000\000\004", null, null} ; [ DW_TAG_base_type ] [double] [line 0, size 64, align 64, offset 0, enc DW_ATE_float] -!17 = !{!"0x100\00limit\008\000", !4, !5, !8} ; [ DW_TAG_auto_variable ] [limit] [line 8] -!18 = !{!"0x100\00s\0010\000", !19, !5, !16} ; [ DW_TAG_auto_variable ] [s] [line 10] -!19 = !{!"0xb\009\000\000", !1, !20} ; [ DW_TAG_lexical_block ] [./branch.cc] -!20 = !{!"0xb\009\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [./branch.cc] -!21 = !{!"0x100\00u\0011\000", !22, !5, !8} ; [ DW_TAG_auto_variable ] [u] [line 11] -!22 = !{!"0xb\0011\000\000", !1, !19} ; [ DW_TAG_lexical_block ] [./branch.cc] -!23 = !{!"0x100\00x\0012\000", !24, !5, !16} ; [ DW_TAG_auto_variable ] [x] [line 12] -!24 = !{!"0xb\0011\000\000", !1, !22} ; [ DW_TAG_lexical_block ] [./branch.cc] +!13 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "argc", line: 4, arg: 1, scope: !4, file: !5, type: !8) +!14 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "argv", line: 4, arg: 2, scope: !4, file: !5, type: !9) +!15 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "result", line: 7, scope: !4, file: !5, type: !16) +!16 = !MDBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float) +!17 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "limit", line: 8, scope: !4, file: !5, type: !8) +!18 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "s", line: 10, scope: !19, file: !5, type: !16) +!19 = distinct !MDLexicalBlock(line: 9, column: 0, file: !1, scope: !20) +!20 = distinct !MDLexicalBlock(line: 9, column: 0, file: !1, scope: !4) +!21 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "u", line: 11, scope: !22, file: !5, type: !8) +!22 = distinct !MDLexicalBlock(line: 11, column: 0, file: !1, scope: !19) +!23 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "x", line: 12, scope: !24, file: !5, type: !16) +!24 = distinct !MDLexicalBlock(line: 11, column: 0, file: !1, scope: !22) !25 = !{i32 2, !"Dwarf Version", i32 4} !26 = !{!"clang version 3.4 (trunk 192896) (llvm/trunk 192895)"} !27 = !MDLocation(line: 4, scope: !4) !28 = !MDLocation(line: 5, scope: !29) -!29 = !{!"0xb\005\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [./branch.cc] +!29 = distinct !MDLexicalBlock(line: 5, column: 0, file: !1, scope: !4) !30 = !MDLocation(line: 8, scope: !4) !31 = !{!32, !32, i64 0} !32 = !{!"any pointer", !33, i64 0} @@ -140,4 +140,4 @@ attributes #4 = { nounwind readonly } !39 = !MDLocation(line: 20, scope: !4) !40 = !MDLocation(line: 21, scope: !4) !41 = !MDLocation(line: 22, scope: !4) -!42 = !{i32 1, !"Debug Info Version", i32 2} +!42 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/SampleProfile/calls.ll b/test/Transforms/SampleProfile/calls.ll index d566609..7576dcb 100644 --- a/test/Transforms/SampleProfile/calls.ll +++ b/test/Transforms/SampleProfile/calls.ll @@ -30,8 +30,8 @@ entry: %y.addr = alloca i32, align 4 store i32 %x, i32* %x.addr, align 4 store i32 %y, i32* %y.addr, align 4 - %0 = load i32* %x.addr, align 4, !dbg !11 - %1 = load i32* %y.addr, align 4, !dbg !11 + %0 = load i32, i32* %x.addr, align 4, !dbg !11 + %1 = load i32, i32* %y.addr, align 4, !dbg !11 %add = add nsw i32 %0, %1, !dbg !11 ret i32 %add, !dbg !11 } @@ -47,7 +47,7 @@ entry: br label %while.cond, !dbg !13 while.cond: ; preds = %if.end, %entry - %0 = load i32* %i, align 4, !dbg !14 + %0 = load i32, i32* %i, align 4, !dbg !14 %inc = add nsw i32 %0, 1, !dbg !14 store i32 %inc, i32* %i, align 4, !dbg !14 %cmp = icmp slt i32 %0, 400000000, !dbg !14 @@ -56,7 +56,7 @@ while.cond: ; preds = %if.end, %entry ; CHECK: edge while.cond -> while.end probability is 1 / 5392 = 0.018546% while.body: ; preds = %while.cond - %1 = load i32* %i, align 4, !dbg !16 + %1 = load i32, i32* %i, align 4, !dbg !16 %cmp1 = icmp ne i32 %1, 100, !dbg !16 br i1 %cmp1, label %if.then, label %if.else, !dbg !16 ; Without discriminator information, the profiler used to think that @@ -68,8 +68,8 @@ while.body: ; preds = %while.cond if.then: ; preds = %while.body - %2 = load i32* %i, align 4, !dbg !18 - %3 = load i32* %s, align 4, !dbg !18 + %2 = load i32, i32* %i, align 4, !dbg !18 + %3 = load i32, i32* %s, align 4, !dbg !18 %call = call i32 @_Z3sumii(i32 %2, i32 %3), !dbg !18 store i32 %call, i32* %s, align 4, !dbg !18 br label %if.end, !dbg !18 @@ -82,8 +82,8 @@ if.end: ; preds = %if.else, %if.then br label %while.cond, !dbg !22 while.end: ; preds = %while.cond - %4 = load i32* %s, align 4, !dbg !24 - %call2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8]* @.str, i32 0, i32 0), i32 %4), !dbg !24 + %4 = load i32, i32* %s, align 4, !dbg !24 + %call2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %4), !dbg !24 ret i32 0, !dbg !25 } @@ -92,29 +92,29 @@ declare i32 @printf(i8*, ...) #2 !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !{!"0x11\004\00clang version 3.5 \000\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [./calls.cc] [DW_LANG_C_plus_plus] -!1 = !{!"calls.cc", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "calls.cc", directory: ".") !2 = !{} !3 = !{!4, !7} -!4 = !{!"0x2e\00sum\00sum\00\003\000\001\000\006\00256\000\003", !1, !5, !6, null, i32 (i32, i32)* @_Z3sumii, null, null, !2} ; [ DW_TAG_subprogram ] [line 3] [def] [sum] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [./calls.cc] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] -!7 = !{!"0x2e\00main\00main\00\007\000\001\000\006\00256\000\007", !1, !5, !6, null, i32 ()* @main, null, null, !2} ; [ DW_TAG_subprogram ] [line 7] [def] [main] +!4 = !MDSubprogram(name: "sum", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: i32 (i32, i32)* @_Z3sumii, variables: !2) +!5 = !MDFile(filename: "calls.cc", directory: ".") +!6 = !MDSubroutineType(types: !2) +!7 = !MDSubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2) !8 = !{i32 2, !"Dwarf Version", i32 4} -!9 = !{i32 1, !"Debug Info Version", i32 2} +!9 = !{i32 1, !"Debug Info Version", i32 3} !10 = !{!"clang version 3.5 "} !11 = !MDLocation(line: 4, scope: !4) !12 = !MDLocation(line: 8, scope: !7) !13 = !MDLocation(line: 9, scope: !7) !14 = !MDLocation(line: 9, scope: !15) -!15 = !{!"0xb\001", !1, !7} ; [ DW_TAG_lexical_block ] [./calls.cc] +!15 = !MDLexicalBlockFile(discriminator: 1, file: !1, scope: !7) !16 = !MDLocation(line: 10, scope: !17) -!17 = !{!"0xb\0010\000\000", !1, !7} ; [ DW_TAG_lexical_block ] [./calls.cc] +!17 = distinct !MDLexicalBlock(line: 10, column: 0, file: !1, scope: !7) !18 = !MDLocation(line: 10, scope: !19) -!19 = !{!"0xb\001", !1, !17} ; [ DW_TAG_lexical_block ] [./calls.cc] +!19 = !MDLexicalBlockFile(discriminator: 1, file: !1, scope: !17) !20 = !MDLocation(line: 10, scope: !21) -!21 = !{!"0xb\002", !1, !17} ; [ DW_TAG_lexical_block ] [./calls.cc] +!21 = !MDLexicalBlockFile(discriminator: 2, file: !1, scope: !17) !22 = !MDLocation(line: 10, scope: !23) -!23 = !{!"0xb\003", !1, !17} ; [ DW_TAG_lexical_block ] [./calls.cc] +!23 = !MDLexicalBlockFile(discriminator: 3, file: !1, scope: !17) !24 = !MDLocation(line: 11, scope: !7) !25 = !MDLocation(line: 12, scope: !7) diff --git a/test/Transforms/SampleProfile/discriminator.ll b/test/Transforms/SampleProfile/discriminator.ll index cafc69d..1f3a12f 100644 --- a/test/Transforms/SampleProfile/discriminator.ll +++ b/test/Transforms/SampleProfile/discriminator.ll @@ -31,33 +31,33 @@ entry: br label %while.cond, !dbg !11 while.cond: ; preds = %if.end, %entry - %0 = load i32* %i.addr, align 4, !dbg !12 + %0 = load i32, i32* %i.addr, align 4, !dbg !12 %cmp = icmp slt i32 %0, 100, !dbg !12 br i1 %cmp, label %while.body, label %while.end, !dbg !12 ; CHECK: edge while.cond -> while.body probability is 100 / 101 = 99.0099% [HOT edge] ; CHECK: edge while.cond -> while.end probability is 1 / 101 = 0.990099% while.body: ; preds = %while.cond - %1 = load i32* %i.addr, align 4, !dbg !14 + %1 = load i32, i32* %i.addr, align 4, !dbg !14 %cmp1 = icmp slt i32 %1, 50, !dbg !14 br i1 %cmp1, label %if.then, label %if.end, !dbg !14 ; CHECK: edge while.body -> if.then probability is 5 / 100 = 5% ; CHECK: edge while.body -> if.end probability is 95 / 100 = 95% [HOT edge] if.then: ; preds = %while.body - %2 = load i32* %x, align 4, !dbg !17 + %2 = load i32, i32* %x, align 4, !dbg !17 %dec = add nsw i32 %2, -1, !dbg !17 store i32 %dec, i32* %x, align 4, !dbg !17 br label %if.end, !dbg !17 if.end: ; preds = %if.then, %while.body - %3 = load i32* %i.addr, align 4, !dbg !19 + %3 = load i32, i32* %i.addr, align 4, !dbg !19 %inc = add nsw i32 %3, 1, !dbg !19 store i32 %inc, i32* %i.addr, align 4, !dbg !19 br label %while.cond, !dbg !20 while.end: ; preds = %while.cond - %4 = load i32* %x, align 4, !dbg !21 + %4 = load i32, i32* %x, align 4, !dbg !21 ret i32 %4, !dbg !21 } @@ -66,25 +66,25 @@ while.end: ; preds = %while.cond !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = !{!"0x11\0012\00clang version 3.5 \000\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [discriminator.c] [DW_LANG_C99] -!1 = !{!"discriminator.c", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "discriminator.c", directory: ".") !2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00foo\00foo\00\001\000\001\000\006\00256\000\001", !1, !5, !6, null, i32 (i32)* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [discriminator.c] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i32)* @foo, variables: !2) +!5 = !MDFile(filename: "discriminator.c", directory: ".") +!6 = !MDSubroutineType(types: !2) !7 = !{i32 2, !"Dwarf Version", i32 4} -!8 = !{i32 1, !"Debug Info Version", i32 2} +!8 = !{i32 1, !"Debug Info Version", i32 3} !9 = !{!"clang version 3.5 "} !10 = !MDLocation(line: 2, scope: !4) !11 = !MDLocation(line: 3, scope: !4) !12 = !MDLocation(line: 3, scope: !13) -!13 = !{!"0xb\001", !1, !4} ; [ DW_TAG_lexical_block ] [discriminator.c] +!13 = !MDLexicalBlockFile(discriminator: 1, file: !1, scope: !4) !14 = !MDLocation(line: 4, scope: !15) -!15 = !{!"0xb\004\000\001", !1, !16} ; [ DW_TAG_lexical_block ] [discriminator.c] -!16 = !{!"0xb\003\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [discriminator.c] +!15 = distinct !MDLexicalBlock(line: 4, column: 0, file: !1, scope: !16) +!16 = distinct !MDLexicalBlock(line: 3, column: 0, file: !1, scope: !4) !17 = !MDLocation(line: 4, scope: !18) -!18 = !{!"0xb\001", !1, !15} ; [ DW_TAG_lexical_block ] [discriminator.c] +!18 = !MDLexicalBlockFile(discriminator: 1, file: !1, scope: !15) !19 = !MDLocation(line: 5, scope: !16) !20 = !MDLocation(line: 6, scope: !16) !21 = !MDLocation(line: 7, scope: !4) diff --git a/test/Transforms/SampleProfile/fnptr.ll b/test/Transforms/SampleProfile/fnptr.ll index 096033b..07c3c75 100644 --- a/test/Transforms/SampleProfile/fnptr.ll +++ b/test/Transforms/SampleProfile/fnptr.ll @@ -114,7 +114,7 @@ for.inc12: ; preds = %for.inc for.end14: ; preds = %for.inc12 %S.2.lcssa.lcssa = phi double [ %S.2.lcssa, %for.inc12 ] - %call15 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x i8]* @.str, i64 0, i64 0), double %S.2.lcssa.lcssa), !dbg !24 + %call15 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %S.2.lcssa.lcssa), !dbg !24 ret i32 0, !dbg !25 } @@ -127,20 +127,20 @@ declare i32 @printf(i8* nocapture readonly, ...) #1 !llvm.module.flags = !{!0} !llvm.ident = !{!1} -!0 = !{i32 2, !"Debug Info Version", i32 2} +!0 = !{i32 2, !"Debug Info Version", i32 3} !1 = !{!"clang version 3.6.0 "} !2 = !MDLocation(line: 9, column: 3, scope: !3) -!3 = !{!"0x2e\00foo\00foo\00\008\000\001\000\000\00256\001\008", !4, !5, !6, null, double (i32)* @_Z3fooi, null, null, !7} ; [ DW_TAG_subprogram ] [line 8] [def] [foo] -!4 = !{!"fnptr.cc", !"."} -!5 = !{!"0x29", !4} ; [ DW_TAG_file_type ] [./fnptr.cc] -!6 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!3 = !MDSubprogram(name: "foo", line: 8, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 8, file: !4, scope: !5, type: !6, function: double (i32)* @_Z3fooi, variables: !7) +!4 = !MDFile(filename: "fnptr.cc", directory: ".") +!5 = !MDFile(filename: "fnptr.cc", directory: ".") +!6 = !MDSubroutineType(types: !7) !7 = !{} !8 = !MDLocation(line: 9, column: 14, scope: !3) !9 = !MDLocation(line: 13, column: 3, scope: !10) -!10 = !{!"0x2e\00bar\00bar\00\0012\000\001\000\000\00256\001\0012", !4, !5, !6, null, double (i32)* @_Z3bari, null, null, !7} ; [ DW_TAG_subprogram ] [line 12] [def] [bar] +!10 = !MDSubprogram(name: "bar", line: 12, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 12, file: !4, scope: !5, type: !6, function: double (i32)* @_Z3bari, variables: !7) !11 = !MDLocation(line: 13, column: 14, scope: !10) !12 = !MDLocation(line: 19, column: 3, scope: !13) -!13 = !{!"0x2e\00main\00main\00\0016\000\001\000\000\00256\001\0016", !4, !5, !6, null, i32 ()* @main, null, null, !7} ; [ DW_TAG_subprogram ] [line 16] [def] [main] +!13 = !MDSubprogram(name: "main", line: 16, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 16, file: !4, scope: !5, type: !6, function: i32 ()* @main, variables: !7) !14 = !MDLocation(line: 20, column: 5, scope: !13) !15 = !MDLocation(line: 21, column: 15, scope: !13) !16 = !MDLocation(line: 22, column: 11, scope: !13) diff --git a/test/Transforms/SampleProfile/propagate.ll b/test/Transforms/SampleProfile/propagate.ll index 594645f..fc9dedb 100644 --- a/test/Transforms/SampleProfile/propagate.ll +++ b/test/Transforms/SampleProfile/propagate.ll @@ -51,14 +51,14 @@ entry: store i32 %x, i32* %x.addr, align 4 store i32 %y, i32* %y.addr, align 4 store i64 %N, i64* %N.addr, align 8 - %0 = load i32* %x.addr, align 4, !dbg !11 - %1 = load i32* %y.addr, align 4, !dbg !11 + %0 = load i32, i32* %x.addr, align 4, !dbg !11 + %1 = load i32, i32* %y.addr, align 4, !dbg !11 %cmp = icmp slt i32 %0, %1, !dbg !11 br i1 %cmp, label %if.then, label %if.else, !dbg !11 if.then: ; preds = %entry - %2 = load i32* %y.addr, align 4, !dbg !13 - %3 = load i32* %x.addr, align 4, !dbg !13 + %2 = load i32, i32* %y.addr, align 4, !dbg !13 + %3 = load i32, i32* %x.addr, align 4, !dbg !13 %sub = sub nsw i32 %2, %3, !dbg !13 %conv = sext i32 %sub to i64, !dbg !13 store i64 %conv, i64* %retval, !dbg !13 @@ -69,16 +69,16 @@ if.else: ; preds = %entry br label %for.cond, !dbg !15 for.cond: ; preds = %for.inc16, %if.else - %4 = load i64* %i, align 8, !dbg !15 - %5 = load i64* %N.addr, align 8, !dbg !15 + %4 = load i64, i64* %i, align 8, !dbg !15 + %5 = load i64, i64* %N.addr, align 8, !dbg !15 %cmp1 = icmp slt i64 %4, %5, !dbg !15 br i1 %cmp1, label %for.body, label %for.end18, !dbg !15 ; CHECK: edge for.cond -> for.body probability is 10 / 11 = 90.9091% [HOT edge] ; CHECK: edge for.cond -> for.end18 probability is 1 / 11 = 9.09091% for.body: ; preds = %for.cond - %6 = load i64* %i, align 8, !dbg !18 - %7 = load i64* %N.addr, align 8, !dbg !18 + %6 = load i64, i64* %i, align 8, !dbg !18 + %7 = load i64, i64* %N.addr, align 8, !dbg !18 %div = sdiv i64 %7, 3, !dbg !18 %cmp2 = icmp sgt i64 %6, %div, !dbg !18 br i1 %cmp2, label %if.then3, label %if.end, !dbg !18 @@ -86,14 +86,14 @@ for.body: ; preds = %for.cond ; CHECK: edge for.body -> if.end probability is 4 / 5 = 80% if.then3: ; preds = %for.body - %8 = load i32* %x.addr, align 4, !dbg !21 + %8 = load i32, i32* %x.addr, align 4, !dbg !21 %dec = add nsw i32 %8, -1, !dbg !21 store i32 %dec, i32* %x.addr, align 4, !dbg !21 br label %if.end, !dbg !21 if.end: ; preds = %if.then3, %for.body - %9 = load i64* %i, align 8, !dbg !22 - %10 = load i64* %N.addr, align 8, !dbg !22 + %9 = load i64, i64* %i, align 8, !dbg !22 + %10 = load i64, i64* %N.addr, align 8, !dbg !22 %div4 = sdiv i64 %10, 4, !dbg !22 %cmp5 = icmp sgt i64 %9, %div4, !dbg !22 br i1 %cmp5, label %if.then6, label %if.else7, !dbg !22 @@ -101,10 +101,10 @@ if.end: ; preds = %if.then3, %for.body ; CHECK: edge if.end -> if.else7 probability is 6339 / 6342 = 99.9527% [HOT edge] if.then6: ; preds = %if.end - %11 = load i32* %y.addr, align 4, !dbg !24 + %11 = load i32, i32* %y.addr, align 4, !dbg !24 %inc = add nsw i32 %11, 1, !dbg !24 store i32 %inc, i32* %y.addr, align 4, !dbg !24 - %12 = load i32* %x.addr, align 4, !dbg !26 + %12 = load i32, i32* %x.addr, align 4, !dbg !26 %add = add nsw i32 %12, 3, !dbg !26 store i32 %add, i32* %x.addr, align 4, !dbg !26 br label %if.end15, !dbg !27 @@ -114,26 +114,26 @@ if.else7: ; preds = %if.end br label %for.cond8, !dbg !28 for.cond8: ; preds = %for.inc, %if.else7 - %13 = load i32* %j, align 4, !dbg !28 + %13 = load i32, i32* %j, align 4, !dbg !28 %conv9 = zext i32 %13 to i64, !dbg !28 - %14 = load i64* %i, align 8, !dbg !28 + %14 = load i64, i64* %i, align 8, !dbg !28 %cmp10 = icmp slt i64 %conv9, %14, !dbg !28 br i1 %cmp10, label %for.body11, label %for.end, !dbg !28 ; CHECK: edge for.cond8 -> for.body11 probability is 16191 / 16192 = 99.9938% [HOT edge] ; CHECK: edge for.cond8 -> for.end probability is 1 / 16192 = 0.00617589% for.body11: ; preds = %for.cond8 - %15 = load i32* %j, align 4, !dbg !31 - %16 = load i32* %x.addr, align 4, !dbg !31 + %15 = load i32, i32* %j, align 4, !dbg !31 + %16 = load i32, i32* %x.addr, align 4, !dbg !31 %add12 = add i32 %16, %15, !dbg !31 store i32 %add12, i32* %x.addr, align 4, !dbg !31 - %17 = load i32* %y.addr, align 4, !dbg !33 + %17 = load i32, i32* %y.addr, align 4, !dbg !33 %sub13 = sub nsw i32 %17, 3, !dbg !33 store i32 %sub13, i32* %y.addr, align 4, !dbg !33 br label %for.inc, !dbg !34 for.inc: ; preds = %for.body11 - %18 = load i32* %j, align 4, !dbg !28 + %18 = load i32, i32* %j, align 4, !dbg !28 %inc14 = add i32 %18, 1, !dbg !28 store i32 %inc14, i32* %j, align 4, !dbg !28 br label %for.cond8, !dbg !28 @@ -145,7 +145,7 @@ if.end15: ; preds = %for.end, %if.then6 br label %for.inc16, !dbg !35 for.inc16: ; preds = %if.end15 - %19 = load i64* %i, align 8, !dbg !15 + %19 = load i64, i64* %i, align 8, !dbg !15 %inc17 = add nsw i64 %19, 1, !dbg !15 store i64 %inc17, i64* %i, align 8, !dbg !15 br label %for.cond, !dbg !15 @@ -154,15 +154,15 @@ for.end18: ; preds = %for.cond br label %if.end19 if.end19: ; preds = %for.end18 - %20 = load i32* %y.addr, align 4, !dbg !36 - %21 = load i32* %x.addr, align 4, !dbg !36 + %20 = load i32, i32* %y.addr, align 4, !dbg !36 + %21 = load i32, i32* %x.addr, align 4, !dbg !36 %mul = mul nsw i32 %20, %21, !dbg !36 %conv20 = sext i32 %mul to i64, !dbg !36 store i64 %conv20, i64* %retval, !dbg !36 br label %return, !dbg !36 return: ; preds = %if.end19, %if.then - %22 = load i64* %retval, !dbg !37 + %22 = load i64, i64* %retval, !dbg !37 ret i64 %22, !dbg !37 } @@ -177,14 +177,14 @@ entry: store i32 5678, i32* %x, align 4, !dbg !38 store i32 1234, i32* %y, align 4, !dbg !39 store i64 999999, i64* %N, align 8, !dbg !40 - %0 = load i32* %x, align 4, !dbg !41 - %1 = load i32* %y, align 4, !dbg !41 - %2 = load i64* %N, align 8, !dbg !41 - %3 = load i32* %x, align 4, !dbg !41 - %4 = load i32* %y, align 4, !dbg !41 - %5 = load i64* %N, align 8, !dbg !41 + %0 = load i32, i32* %x, align 4, !dbg !41 + %1 = load i32, i32* %y, align 4, !dbg !41 + %2 = load i64, i64* %N, align 8, !dbg !41 + %3 = load i32, i32* %x, align 4, !dbg !41 + %4 = load i32, i32* %y, align 4, !dbg !41 + %5 = load i64, i64* %N, align 8, !dbg !41 %call = call i64 @_Z3fooiil(i32 %3, i32 %4, i64 %5), !dbg !41 - %call1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([24 x i8]* @.str, i32 0, i32 0), i32 %0, i32 %1, i64 %2, i64 %call), !dbg !41 + %call1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i32 0, i32 0), i32 %0, i32 %1, i64 %2, i64 %call), !dbg !41 ret i32 0, !dbg !42 } @@ -198,39 +198,39 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !{!"0x11\004\00clang version 3.5 \000\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [propagate.cc] [DW_LANG_C_plus_plus] -!1 = !{!"propagate.cc", !"."} -!2 = !{i32 0} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "propagate.cc", directory: ".") +!2 = !{} !3 = !{!4, !7} -!4 = !{!"0x2e\00foo\00foo\00\003\000\001\000\006\00256\000\003", !1, !5, !6, null, i64 (i32, i32, i64)* @_Z3fooiil, null, null, !2} ; [ DW_TAG_subprogram ] [line 3] [def] [foo] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [propagate.cc] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] -!7 = !{!"0x2e\00main\00main\00\0024\000\001\000\006\00256\000\0024", !1, !5, !6, null, i32 ()* @main, null, null, !2} ; [ DW_TAG_subprogram ] [line 24] [def] [main] +!4 = !MDSubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: i64 (i32, i32, i64)* @_Z3fooiil, variables: !2) +!5 = !MDFile(filename: "propagate.cc", directory: ".") +!6 = !MDSubroutineType(types: !{null}) +!7 = !MDSubprogram(name: "main", line: 24, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 24, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2) !8 = !{i32 2, !"Dwarf Version", i32 4} -!9 = !{i32 1, !"Debug Info Version", i32 2} +!9 = !{i32 1, !"Debug Info Version", i32 3} !10 = !{!"clang version 3.5 "} !11 = !MDLocation(line: 4, scope: !12) -!12 = !{!"0xb\004\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [propagate.cc] +!12 = distinct !MDLexicalBlock(line: 4, column: 0, file: !1, scope: !4) !13 = !MDLocation(line: 5, scope: !14) -!14 = !{!"0xb\004\000\000", !1, !12} ; [ DW_TAG_lexical_block ] [propagate.cc] +!14 = distinct !MDLexicalBlock(line: 4, column: 0, file: !1, scope: !12) !15 = !MDLocation(line: 7, scope: !16) -!16 = !{!"0xb\007\000\000", !1, !17} ; [ DW_TAG_lexical_block ] [propagate.cc] -!17 = !{!"0xb\006\000\000", !1, !12} ; [ DW_TAG_lexical_block ] [propagate.cc] +!16 = distinct !MDLexicalBlock(line: 7, column: 0, file: !1, scope: !17) +!17 = distinct !MDLexicalBlock(line: 6, column: 0, file: !1, scope: !12) !18 = !MDLocation(line: 8, scope: !19) -!19 = !{!"0xb\008\000\000", !1, !20} ; [ DW_TAG_lexical_block ] [propagate.cc] -!20 = !{!"0xb\007\000\000", !1, !16} ; [ DW_TAG_lexical_block ] [propagate.cc] +!19 = distinct !MDLexicalBlock(line: 8, column: 0, file: !1, scope: !20) +!20 = distinct !MDLexicalBlock(line: 7, column: 0, file: !1, scope: !16) !21 = !MDLocation(line: 9, scope: !19) !22 = !MDLocation(line: 10, scope: !23) -!23 = !{!"0xb\0010\000\000", !1, !20} ; [ DW_TAG_lexical_block ] [propagate.cc] +!23 = distinct !MDLexicalBlock(line: 10, column: 0, file: !1, scope: !20) !24 = !MDLocation(line: 11, scope: !25) -!25 = !{!"0xb\0010\000\000", !1, !23} ; [ DW_TAG_lexical_block ] [propagate.cc] +!25 = distinct !MDLexicalBlock(line: 10, column: 0, file: !1, scope: !23) !26 = !MDLocation(line: 12, scope: !25) !27 = !MDLocation(line: 13, scope: !25) !28 = !MDLocation(line: 14, scope: !29) -!29 = !{!"0xb\0014\000\000", !1, !30} ; [ DW_TAG_lexical_block ] [propagate.cc] -!30 = !{!"0xb\0013\000\000", !1, !23} ; [ DW_TAG_lexical_block ] [propagate.cc] +!29 = distinct !MDLexicalBlock(line: 14, column: 0, file: !1, scope: !30) +!30 = distinct !MDLexicalBlock(line: 13, column: 0, file: !1, scope: !23) !31 = !MDLocation(line: 15, scope: !32) -!32 = !{!"0xb\0014\000\000", !1, !29} ; [ DW_TAG_lexical_block ] [propagate.cc] +!32 = distinct !MDLexicalBlock(line: 14, column: 0, file: !1, scope: !29) !33 = !MDLocation(line: 16, scope: !32) !34 = !MDLocation(line: 17, scope: !32) !35 = !MDLocation(line: 19, scope: !20) |