Skip to content

Commit 85dccaf

Browse files
fix line number
1 parent 73d6985 commit 85dccaf

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

compiler-rt/test/profile/Linux/instrprof-vtable-value-prof.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: lld-available
1+
// REQUIRES: lld, lld-available
22

33
// Building the instrumented binary will fail because lld doesn't support
44
// big-endian ELF for PPC (aka ABI 1).
@@ -142,12 +142,12 @@
142142
// RUN: | FileCheck %s --check-prefixes=REMARK,IR --implicit-check-not="!VP"
143143

144144
// For the indirect call site `ptr->func`
145-
// REMARK: instrprof-vtable-value-prof.cpp:214:19: Promote indirect call to _ZN12_GLOBAL__N_18Derived24funcEii with count 150 out of 200, sink 1 instruction(s) and compare 1 vtable(s): {_ZTVN12_GLOBAL__N_18Derived2E}
146-
// REMARK: instrprof-vtable-value-prof.cpp:214:19: Promote indirect call to _ZN8Derived14funcEii with count 50 out of 50, sink 1 instruction(s) and compare 1 vtable(s): {_ZTV8Derived1}
145+
// REMARK: instrprof-vtable-value-prof.cpp:221:19: Promote indirect call to _ZN12_GLOBAL__N_18Derived24funcEii with count 150 out of 200, sink 1 instruction(s) and compare 1 vtable(s): {_ZTVN12_GLOBAL__N_18Derived2E}
146+
// REMARK: instrprof-vtable-value-prof.cpp:221:19: Promote indirect call to _ZN8Derived14funcEii with count 50 out of 50, sink 1 instruction(s) and compare 1 vtable(s): {_ZTV8Derived1}
147147
//
148148
// For the indirect call site `delete ptr`
149-
// REMARK: instrprof-vtable-value-prof.cpp:216:5: Promote indirect call to _ZN12_GLOBAL__N_18Derived2D0Ev with count 750 out of 1000, sink 2 instruction(s) and compare 1 vtable(s): {_ZTVN12_GLOBAL__N_18Derived2E}
150-
// REMARK: instrprof-vtable-value-prof.cpp:216:5: Promote indirect call to _ZN8Derived1D0Ev with count 250 out of 250, sink 2 instruction(s) and compare 1 vtable(s): {_ZTV8Derived1}
149+
// REMARK: instrprof-vtable-value-prof.cpp:223:5: Promote indirect call to _ZN12_GLOBAL__N_18Derived2D0Ev with count 750 out of 1000, sink 2 instruction(s) and compare 1 vtable(s): {_ZTVN12_GLOBAL__N_18Derived2E}
150+
// REMARK: instrprof-vtable-value-prof.cpp:223:5: Promote indirect call to _ZN8Derived1D0Ev with count 250 out of 250, sink 2 instruction(s) and compare 1 vtable(s): {_ZTV8Derived1}
151151

152152
// The IR matchers for indirect callsite `ptr->func`.
153153
// IR-LABEL: @main

llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,11 +1760,11 @@ void PGOUseFunc::annotateValueSites(uint32_t Kind) {
17601760
unsigned NumValueSites = ProfileRecord.getNumValueSites(Kind);
17611761
// FuncPGOInstrumentation ctor finds value sites for each kind. It runs on the
17621762
// common path of pgo-instr-gen and pgo-instr-use, and vtable kind path
1763-
// is gated by `-enable-vtable-value-profiling`. Give pgo-instr-use pass a
1764-
// second chance to find out vtable value sites when vtable profiles are
1765-
// present and `-enable-vtable-profile-use` is not explicitly off.
1763+
// is gated by `-enable-vtable-value-profiling`. If vtable profiles are
1764+
// present, not explicitly discarded and vtable sites remain empty, try to
1765+
// find the sites again.
17661766
if (NumValueSites > 0 && Kind == IPVK_VTableTarget &&
1767-
NumValueSites != FuncInfo.ValueSites[IPVK_VTableTarget].size() &&
1767+
FuncInfo.ValueSites[Kind].empty() &&
17681768
!(EnableVTableProfileUse.getNumOccurrences() &&
17691769
EnableVTableProfileUse == false))
17701770
FuncInfo.ValueSites[IPVK_VTableTarget] = VPC.get(IPVK_VTableTarget);

0 commit comments

Comments
 (0)