|
1 |
| -// REQUIRES: lld, lld-available |
| 1 | +// REQUIRES: lld-available |
2 | 2 |
|
3 | 3 | // Building the instrumented binary will fail because lld doesn't support
|
4 | 4 | // big-endian ELF for PPC (aka ABI 1).
|
|
109 | 109 | // ICTEXT: {{.*}}instrprof-vtable-value-prof.cpp;_ZTVN12_GLOBAL__N_18Derived2E:750
|
110 | 110 | // ICTEXT: _ZTV8Derived1:250
|
111 | 111 |
|
| 112 | +// When vtable value profiles exist, pgo-instr-use pass should annotate them |
| 113 | +// even if `-enable-vtable-value-profiling` is not explicitly on. |
| 114 | +// RUN: %clangxx -m64 -fprofile-use=test.profdata -fuse-ld=lld -O2 -mllvm -print-after=pgo-instr-use -mllvm -filter-print-funcs=main -mllvm -print-module-scope %s 2>&1 | FileCheck %s --check-prefix=ANNOTATE |
| 115 | + |
| 116 | +// ANNOTATE-NOT: Inconsistent number of value sites |
| 117 | +// ANNOTATE: !{!"VP", i32 2 |
| 118 | + |
| 119 | +// When vtable value profiles exist, pgo-instr-use pass will not annotate them |
| 120 | +// if `-enable-vtable-profile-use` is explicitly off. |
| 121 | +// RUN: %clangxx -m64 -fprofile-use=test.profdata -fuse-ld=lld -O2 -mllvm -enable-vtable-profile-use=false -mllvm -print-after=pgo-instr-use -mllvm -filter-print-funcs=main -mllvm -print-module-scope %s 2>&1 | FileCheck %s --check-prefix=OMIT |
| 122 | + |
| 123 | +// OMIT: Inconsistent number of value sites |
| 124 | +// OMIT-NOT: !{!"VP", i32 2 |
| 125 | + |
112 | 126 | // Test indirect call promotion transformation using vtable profiles.
|
113 | 127 | // - Build with `-g` to enable debug information.
|
114 | 128 | // - In real world settings, ICP pass is disabled in prelink pipeline. In
|
|
128 | 142 | // RUN: | FileCheck %s --check-prefixes=REMARK,IR --implicit-check-not="!VP"
|
129 | 143 |
|
130 | 144 | // For the indirect call site `ptr->func`
|
131 |
| -// REMARK: instrprof-vtable-value-prof.cpp:205: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} |
132 |
| -// REMARK: instrprof-vtable-value-prof.cpp:205: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: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} |
133 | 147 | //
|
134 | 148 | // For the indirect call site `delete ptr`
|
135 |
| -// REMARK: instrprof-vtable-value-prof.cpp:207: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} |
136 |
| -// REMARK: instrprof-vtable-value-prof.cpp:207: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: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} |
137 | 151 |
|
138 | 152 | // The IR matchers for indirect callsite `ptr->func`.
|
139 | 153 | // IR-LABEL: @main
|
|
0 commit comments