summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2014-10-22 12:59:00 +0000
committerDiego Novillo <dnovillo@google.com>2014-10-22 12:59:00 +0000
commit8027b80b412574603340e00d42c1a0d08338c1de (patch)
tree7d05246251af8fec4082371aada95db92c4a3a5c /llvm/test
parent9b3330546bcec321d9be6f45edef142ae953c7e0 (diff)
downloadbcm5719-llvm-8027b80b412574603340e00d42c1a0d08338c1de.tar.gz
bcm5719-llvm-8027b80b412574603340e00d42c1a0d08338c1de.zip
Support using sample profiles with partial debug info.
Summary: When using a profile, we used to require the use -gmlt so that we could get access to the line locations. This is used to match line numbers in the input profile to the line numbers in the function's IR. But this is actually not necessary. The driver can provide source location tracking without the emission of debug information. In these cases, the annotation 'llvm.dbg.cu' is missing from the IR, but the actual line location annotations are still present. This patch adds a new way of looking for the start of the current function. Instead of looking through the compile units in llvm.dbg.cu, we can walk up the scope for the first instruction in the function with a debug loc. If that describes the function, we use it. Otherwise, we keep looking until we find one. If no such instruction is found, we then give up and produce an error. Reviewers: echristo, dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5887 llvm-svn: 220382
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/SampleProfile/calls.ll8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/test/Transforms/SampleProfile/calls.ll b/llvm/test/Transforms/SampleProfile/calls.ll
index a80eb956527..c39472bf906 100644
--- a/llvm/test/Transforms/SampleProfile/calls.ll
+++ b/llvm/test/Transforms/SampleProfile/calls.ll
@@ -15,7 +15,12 @@
; printf("sum is %d\n", s);
; return 0;
; }
-
+;
+; Note that this test is missing the llvm.dbg.cu annotation. This emulates
+; the effect of the user having only used -fprofile-sample-use without
+; -gmlt when invoking the driver. In those cases, we need to track source
+; location information but we do not have to generate debug info in the
+; final binary.
@.str = private unnamed_addr constant [11 x i8] c"sum is %d\0A\00", align 1
; Function Attrs: nounwind uwtable
@@ -84,7 +89,6 @@ while.end: ; preds = %while.cond
declare i32 @printf(i8*, ...) #2
-!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!8, !9}
!llvm.ident = !{!10}
OpenPOWER on IntegriCloud