[llvm] r271092 - Bring back r271090 in a way that doesn't depend on r271089.
Sean Silva via llvm-commits
llvm-commits at lists.llvm.org
Fri May 27 21:05:38 PDT 2016
Author: silvas
Date: Fri May 27 23:05:36 2016
New Revision: 271092
URL: http://llvm.org/viewvc/llvm-project?rev=271092&view=rev
Log:
Bring back r271090 in a way that doesn't depend on r271089.
Modified:
llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
llvm/trunk/test/Transforms/PGOProfile/branch1.ll
Modified: llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp?rev=271092&r1=271091&r2=271092&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp Fri May 27 23:05:36 2016
@@ -693,6 +693,7 @@ void PGOUseFunc::populateCounters() {
DEBUG(dbgs() << "Populate counts in " << NumPasses << " passes.\n");
// Assert every BB has a valid counter.
uint64_t FuncEntryCount = getBBInfo(&*F.begin()).CountValue;
+ F.setEntryCount(FuncEntryCount);
uint64_t FuncMaxCount = FuncEntryCount;
for (auto &BB : F) {
assert(getBBInfo(&BB).CountValid && "BB count is not valid");
Modified: llvm/trunk/test/Transforms/PGOProfile/branch1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/branch1.ll?rev=271092&r1=271091&r2=271092&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PGOProfile/branch1.ll (original)
+++ llvm/trunk/test/Transforms/PGOProfile/branch1.ll Fri May 27 23:05:36 2016
@@ -21,6 +21,8 @@ target triple = "x86_64-unknown-linux-gn
; GEN: @__profn_test_br_1 = private constant [9 x i8] c"test_br_1"
define i32 @test_br_1(i32 %i) {
+; USE-LABEL: @test_br_1
+; USE-SAME: !prof ![[FUNC_ENTRY_COUNT:[0-9]+]]
entry:
; GEN: entry:
; GEN-NOT: llvm.instrprof.increment
@@ -44,3 +46,4 @@ if.end:
}
; USE-DAG: {{![0-9]+}} = !{i32 1, !"ProfileSummary", {{![0-9]+}}}
; USE-DAG: {{![0-9]+}} = !{!"DetailedSummary", {{![0-9]+}}}
+; USE-DAG: ![[FUNC_ENTRY_COUNT]] = !{!"function_entry_count", i64 3}
More information about the llvm-commits
mailing list