brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.7 KiB · b2b0a6d Raw
129 lines · plain
1target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"2target triple = "x86_64-unknown-linux-gnu"3 4;; Requires asserts for -debug-only.5; REQUIRES: asserts6 7; RUN: rm -rf %t && split-file %s %t && cd %t8 9; RUN: llc -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic \10; RUN:     -partition-static-data-sections=true \11; RUN:     -debug-only=static-data-profile-info \12; RUN:     -data-sections=true  -unique-section-names=false \13; RUN:     input-with-data-access-prof-on.ll -o - 2>&1 | FileCheck %s --check-prefixes=LOG,IR14 15; RUN: llc -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic \16; RUN:     -partition-static-data-sections=true \17; RUN:     -debug-only=static-data-profile-info \18; RUN:     -data-sections=true  -unique-section-names=false \19; RUN:     input-with-data-access-prof-off.ll -o - 2>&1 | FileCheck %s --check-prefixes=OFF20 21; LOG: hot_bss has section prefix hot, the max from data access profiles as hot and PGO counters as hot22; LOG: data_unknown_hotness has section prefix <empty>, the max from data access profiles as <empty> and PGO counters as unlikely23; LOG: external_relro_array has section prefix unlikely, solely from data access profiles24 25; IR:          .type   hot_bss,@object26; IR-NEXT:     .section .bss.hot.,"aw"27; IR:          .type   data_unknown_hotness,@object28; IR-NEXT:    .section .data,"aw"29; IR:          .type   external_relro_array,@object30; IR-NEXT:     .section        .data.rel.ro.unlikely.,"aw"31 32 33; OFF:        .type   hot_bss,@object34; OFF-NEXT:   .section        .bss.hot.,"aw"35; OFF:        .type   data_unknown_hotness,@object36; OFF-NEXT:   .section        .data.unlikely.,"aw"37;; Global variable section prefix metadata is not used when38;; module flag `EnableDataAccessProf` is 0, and @external_relro_array has39;; external linkage, so analysis based on PGO counters doesn't apply. 40; OFF:        .type   external_relro_array,@object    # @external_relro_array41; OFF-NEXT:   .section        .data.rel.ro,"aw"42 43;--- input-with-data-access-prof-on.ll44; Internal vars45@hot_bss = internal global i32 0, !section_prefix !1746@data_unknown_hotness = internal global i32 147; External vars48@external_relro_array = constant [2 x ptr] [ptr @hot_bss, ptr @data_unknown_hotness], !section_prefix !1849 50define void @cold_func() !prof !15 {51  %9 = load i32, ptr @data_unknown_hotness52  %11 = call i32 (...) @func_taking_arbitrary_param(i32 %9)53  ret void54}55 56define void @hot_func() !prof !14 {57  %9 = load i32, ptr @hot_bss58  %11 = call i32 (...) @func_taking_arbitrary_param(i32 %9)59  ret void60}61 62declare i32 @func_taking_arbitrary_param(...)63 64!llvm.module.flags = !{!0, !1}65 66!0 = !{i32 2, !"EnableDataAccessProf", i32 1}67!1 = !{i32 1, !"ProfileSummary", !2}68!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}69!3 = !{!"ProfileFormat", !"InstrProf"}70!4 = !{!"TotalCount", i64 1460183}71!5 = !{!"MaxCount", i64 849024}72!6 = !{!"MaxInternalCount", i64 32769}73!7 = !{!"MaxFunctionCount", i64 849024}74!8 = !{!"NumCounts", i64 23627}75!9 = !{!"NumFunctions", i64 3271}76!10 = !{!"DetailedSummary", !11}77!11 = !{!12, !13}78!12 = !{i32 990000, i64 166, i32 73}79!13 = !{i32 999999, i64 3, i32 1443}80!14 = !{!"function_entry_count", i64 100000}81!15 = !{!"function_entry_count", i64 1}82!16 = !{!"branch_weights", i32 1, i32 99999}83!17 = !{!"section_prefix", !"hot"}84!18 = !{!"section_prefix", !"unlikely"}85 86;--- input-with-data-access-prof-off.ll87; Same as file above except that module flag `EnableDataAccessProf` has value 0.88; Internal vars89@hot_bss = internal global i32 0, !section_prefix !1790@data_unknown_hotness = internal global i32 191; External vars92@external_relro_array = constant [2 x ptr] [ptr @hot_bss, ptr @data_unknown_hotness], !section_prefix !1893 94define void @cold_func() !prof !15 {95  %9 = load i32, ptr @data_unknown_hotness96  %11 = call i32 (...) @func_taking_arbitrary_param(i32 %9)97  ret void98}99 100define void @hot_func() !prof !14 {101  %9 = load i32, ptr @hot_bss102  %11 = call i32 (...) @func_taking_arbitrary_param(i32 %9)103  ret void104}105 106declare i32 @func_taking_arbitrary_param(...)107 108!llvm.module.flags = !{!0, !1}109 110!0 = !{i32 2, !"EnableDataAccessProf", i32 0}111!1 = !{i32 1, !"ProfileSummary", !2}112!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}113!3 = !{!"ProfileFormat", !"InstrProf"}114!4 = !{!"TotalCount", i64 1460183}115!5 = !{!"MaxCount", i64 849024}116!6 = !{!"MaxInternalCount", i64 32769}117!7 = !{!"MaxFunctionCount", i64 849024}118!8 = !{!"NumCounts", i64 23627}119!9 = !{!"NumFunctions", i64 3271}120!10 = !{!"DetailedSummary", !11}121!11 = !{!12, !13}122!12 = !{i32 990000, i64 166, i32 73}123!13 = !{i32 999999, i64 3, i32 1443}124!14 = !{!"function_entry_count", i64 100000}125!15 = !{!"function_entry_count", i64 1}126!16 = !{!"branch_weights", i32 1, i32 99999}127!17 = !{!"section_prefix", !"hot"}128!18 = !{!"section_prefix", !"unlikely"}129