summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorBetul Buyukkurt <betulb@codeaurora.org>2016-03-31 18:41:34 +0000
committerBetul Buyukkurt <betulb@codeaurora.org>2016-03-31 18:41:34 +0000
commit3da993c4192c64334bf667d53b74378b369973b3 (patch)
tree4ad999ed7de6d26ab4d3d9b3b20ac83a0656fae5 /clang/test
parente1a2e90ffadd810ef6bd580e90b42a83958dfc11 (diff)
downloadbcm5719-llvm-3da993c4192c64334bf667d53b74378b369973b3.tar.gz
bcm5719-llvm-3da993c4192c64334bf667d53b74378b369973b3.zip
[PGO] Avoid instrumenting constants at value sites
Value profiling should not profile constants and/or constant expressions when they appear as callees in call instructions. Constant expressions form when a direct callee has bitcasts or inttoptr(ptrtint (callee)) nests surrounding it. Value profiling should avoid instrumenting such cases. Mostly NFC. llvm-svn: 265037
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Profile/c-avoid-direct-call.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Profile/c-avoid-direct-call.c b/clang/test/Profile/c-avoid-direct-call.c
new file mode 100644
index 00000000000..cd02e714dbe
--- /dev/null
+++ b/clang/test/Profile/c-avoid-direct-call.c
@@ -0,0 +1,11 @@
+// Check the value profiling instrinsics emitted by instrumentation.
+
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-avoid-direct-call.c %s -o - -emit-llvm -fprofile-instrument=clang -mllvm -enable-value-profiling | FileCheck %s
+
+void foo();
+
+int main(void) {
+// CHECK-NOT: call void @__llvm_profile_instrument_target
+ foo(21);
+ return 0;
+}
OpenPOWER on IntegriCloud