[Debugify] Export per-pass debug info loss statistics
Add a -debugify-export option to opt. This exports per-pass `debugify`
loss statistics to a file in CSV format.
For some interesting numbers on debug value loss during an -O2 build
of the sqlite3 amalgamation, see the review thread.
Differential Revision: https://reviews.llvm.org/D49003
llvm-svn: 337787
diff --git a/llvm/test/DebugInfo/debugify-export.ll b/llvm/test/DebugInfo/debugify-export.ll
new file mode 100644
index 0000000..7793035
--- /dev/null
+++ b/llvm/test/DebugInfo/debugify-export.ll
@@ -0,0 +1,14 @@
+; RUN: opt < %s -debugify-each -debugify-quiet -debugify-export - -o /dev/null | FileCheck %s
+
+; CHECK: Pass Name
+; CHECK-SAME: # of missing debug values
+; CHECK-SAME: # of missing locations
+; CHECK-SAME: Missing/Expected value ratio
+; CHECK-SAME: Missing/Expected location ratio
+
+; CHECK: Module Verifier
+; CHECK-SAME: 0,0,0.000000e+00,0.000000e+00
+
+define void @foo() {
+ ret void
+}