summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/test/DebugInfo/check-debugify-preserves-analyses.ll12
-rw-r--r--llvm/tools/opt/Debugify.cpp4
2 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/DebugInfo/check-debugify-preserves-analyses.ll b/llvm/test/DebugInfo/check-debugify-preserves-analyses.ll
new file mode 100644
index 00000000000..58b865f22f9
--- /dev/null
+++ b/llvm/test/DebugInfo/check-debugify-preserves-analyses.ll
@@ -0,0 +1,12 @@
+; RUN: opt < %s -globals-aa -functionattrs | \
+; RUN: opt -S -strip -strip-dead-prototypes -strip-module-flags > %t.no_dbg
+
+; RUN: opt < %s -debugify-each -globals-aa -functionattrs | \
+; RUN: opt -S -strip -strip-dead-prototypes -strip-module-flags > %t.with_dbg
+
+; RUN: diff %t.no_dbg %t.with_dbg
+
+define i32 @f_1(i32 %x) {
+ %tmp = call i32 @f_1(i32 0) [ "deopt"() ]
+ ret i32 0
+}
diff --git a/llvm/tools/opt/Debugify.cpp b/llvm/tools/opt/Debugify.cpp
index 0a900a520ab..f2d79988a5d 100644
--- a/llvm/tools/opt/Debugify.cpp
+++ b/llvm/tools/opt/Debugify.cpp
@@ -275,6 +275,10 @@ struct CheckDebugifyModulePass : public ModulePass {
CheckDebugifyModulePass(bool Strip = false, StringRef NameOfWrappedPass = "")
: ModulePass(ID), Strip(Strip), NameOfWrappedPass(NameOfWrappedPass) {}
+ void getAnalysisUsage(AnalysisUsage &AU) const override {
+ AU.setPreservesAll();
+ }
+
static char ID; // Pass identification.
private:
OpenPOWER on IntegriCloud