mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-01 07:11:45 +00:00
[Debugify] Preserve analyses in -check-debugify
The -check-debugify pass should preserve all analyses. Otherwise, it may invalidate an optional analysis and inadvertently alter codegen. The test case is reduced from deopt-bundle.ll. The result of `opt -O1` on this file would differ when -debugify-each was toggled. That happened because CheckDebugify failed to preserve GlobalsAA. Thanks to Davide Italiano for his help chasing this down! llvm-svn: 333959
This commit is contained in:
parent
7cdb14506b
commit
3fff3d2b73
12
test/DebugInfo/check-debugify-preserves-analyses.ll
Normal file
12
test/DebugInfo/check-debugify-preserves-analyses.ll
Normal file
@ -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
|
||||
}
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user