mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Add a form of addPreserved which takes a string argument, to allow passes
to declare that they preserve other passes without needing to pull in additional header file or library dependencies. Convert MachineFunctionPass and CodeGenLICM to make use of this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83555 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -11,11 +11,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/Analysis/AliasAnalysis.h"
|
||||
#include "llvm/Analysis/ScalarEvolution.h"
|
||||
#include "llvm/Analysis/IVUsers.h"
|
||||
#include "llvm/Analysis/LiveValues.h"
|
||||
#include "llvm/Analysis/MemoryDependenceAnalysis.h"
|
||||
#include "llvm/CodeGen/MachineFunctionAnalysis.h"
|
||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||
using namespace llvm;
|
||||
@ -36,15 +33,18 @@ void MachineFunctionPass::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
|
||||
// MachineFunctionPass preserves all LLVM IR passes, but there's no
|
||||
// high-level way to express this. Instead, just list a bunch of
|
||||
// passes explicitly.
|
||||
// passes explicitly. This does not include setPreservesCFG,
|
||||
// because CodeGen overloads that to mean preserving the MachineBasicBlock
|
||||
// CFG in addition to the LLVM IR CFG.
|
||||
AU.addPreserved<AliasAnalysis>();
|
||||
AU.addPreserved<ScalarEvolution>();
|
||||
AU.addPreserved<IVUsers>();
|
||||
AU.addPreserved<MemoryDependenceAnalysis>();
|
||||
AU.addPreserved<LiveValues>();
|
||||
AU.addPreserved<DominatorTree>();
|
||||
AU.addPreserved<DominanceFrontier>();
|
||||
AU.addPreserved<LoopInfo>();
|
||||
AU.addPreserved("scalar-evolution");
|
||||
AU.addPreserved("iv-users");
|
||||
AU.addPreserved("memdep");
|
||||
AU.addPreserved("live-values");
|
||||
AU.addPreserved("domtree");
|
||||
AU.addPreserved("domfrontier");
|
||||
AU.addPreserved("loops");
|
||||
AU.addPreserved("lda");
|
||||
|
||||
FunctionPass::getAnalysisUsage(AU);
|
||||
}
|
||||
|
Reference in New Issue
Block a user