llvm.org GIT mirror llvm / 7324280
Merging r227294: ------------------------------------------------------------------------ r227294 | chandlerc | 2015-01-27 20:57:56 -0800 (Tue, 27 Jan 2015) | 23 lines [LPM] Stop using the string based preservation API. It is an abomination. For starters, this API is incredibly slow. In order to lookup the name of a pass it must take a memory fence to acquire a pointer to the managed static pass registry, and then potentially acquire locks while it consults this registry for information about what passes exist by that name. This stops the world of LLVMs in your process no matter how little they cared about the result. To make this more joyful, you'll note that we are preserving many passes which *do not exist* any more, or are not even analyses which one might wish to have be preserved. This means we do all the work only to say "nope" with no error to the user. String-based APIs are a *bad idea*. String-based APIs that cannot produce any meaningful error are an even worse idea. =/ I have a patch that simply removes this API completely, but I'm hesitant to commit it as I don't really want to perniciously break out-of-tree users of the old pass manager. I'd rather they just have to migrate to the new one at some point. If others disagree and would like me to kill it with fire, just say the word. =] ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_36@227328 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 4 years ago
7 changed file(s) with 27 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
1010 //
1111 //===----------------------------------------------------------------------===//
1212
13 #include "llvm/CodeGen/MachineFunctionPass.h"
14 #include "llvm/Analysis/AliasAnalysis.h"
15 #include "llvm/Analysis/DominanceFrontier.h"
16 #include "llvm/Analysis/IVUsers.h"
17 #include "llvm/Analysis/LoopInfo.h"
18 #include "llvm/Analysis/LoopInfo.h"
19 #include "llvm/Analysis/MemoryDependenceAnalysis.h"
20 #include "llvm/Analysis/ScalarEvolution.h"
21 #include "llvm/CodeGen/MachineFunctionAnalysis.h"
22 #include "llvm/CodeGen/Passes.h"
23 #include "llvm/CodeGen/StackProtector.h"
24 #include "llvm/IR/Dominators.h"
1325 #include "llvm/IR/Function.h"
14 #include "llvm/Analysis/AliasAnalysis.h"
15 #include "llvm/CodeGen/MachineFunctionAnalysis.h"
16 #include "llvm/CodeGen/MachineFunctionPass.h"
17 #include "llvm/CodeGen/Passes.h"
1826 using namespace llvm;
1927
2028 Pass *MachineFunctionPass::createPrinterPass(raw_ostream &O,
4250 // because CodeGen overloads that to mean preserving the MachineBasicBlock
4351 // CFG in addition to the LLVM IR CFG.
4452 AU.addPreserved();
45 AU.addPreserved("scalar-evolution");
46 AU.addPreserved("iv-users");
47 AU.addPreserved("memdep");
48 AU.addPreserved("live-values");
49 AU.addPreserved("domtree");
50 AU.addPreserved("domfrontier");
51 AU.addPreserved("loops");
52 AU.addPreserved("lda");
53 AU.addPreserved("stack-protector");
53 AU.addPreserved();
54 AU.addPreserved();
55 AU.addPreserved();
56 AU.addPreserved();
57 AU.addPreserved();
58 AU.addPreserved();
59 AU.addPreserved();
5460
5561 FunctionPass::getAnalysisUsage(AU);
5662 }
1414 #include "Hexagon.h"
1515 #include "HexagonTargetMachine.h"
1616 #include "llvm/CodeGen/MachineFunctionAnalysis.h"
17 #include "llvm/CodeGen/StackProtector.h"
1718 #include "llvm/IR/Function.h"
1819 #include "llvm/IR/Instructions.h"
1920 #include "llvm/Pass.h"
4142 void getAnalysisUsage(AnalysisUsage &AU) const override {
4243 AU.addRequired();
4344 AU.addPreserved();
44 AU.addPreserved("stack-protector");
45 AU.addPreserved();
4546 FunctionPass::getAnalysisUsage(AU);
4647 }
4748 };
1414 #define LLVM_LIB_TARGET_NVPTX_NVPTXALLOCAHOISTING_H
1515
1616 #include "llvm/CodeGen/MachineFunctionAnalysis.h"
17 #include "llvm/CodeGen/StackProtector.h"
1718 #include "llvm/IR/DataLayout.h"
1819 #include "llvm/Pass.h"
1920
3132
3233 void getAnalysisUsage(AnalysisUsage &AU) const override {
3334 AU.addRequired();
34 AU.addPreserved("stack-protector");
3535 AU.addPreserved();
36 AU.addPreserved();
3637 }
3738
3839 const char *getPassName() const override {
1515 #define LLVM_LIB_TARGET_NVPTX_NVPTXLOWERAGGRCOPIES_H
1616
1717 #include "llvm/CodeGen/MachineFunctionAnalysis.h"
18 #include "llvm/CodeGen/StackProtector.h"
1819 #include "llvm/IR/DataLayout.h"
1920 #include "llvm/Pass.h"
2021
2829
2930 void getAnalysisUsage(AnalysisUsage &AU) const override {
3031 AU.addRequired();
31 AU.addPreserved("stack-protector");
3232 AU.addPreserved();
33 AU.addPreserved();
3334 }
3435
3536 bool runOnFunction(Function &F) override;
1717 #include "llvm/Analysis/InstructionSimplify.h"
1818 #include "llvm/Analysis/LoopInfo.h"
1919 #include "llvm/Analysis/LoopPass.h"
20 #include "llvm/Analysis/ScalarEvolution.h"
2021 #include "llvm/IR/DataLayout.h"
2122 #include "llvm/IR/Dominators.h"
2223 #include "llvm/IR/Instructions.h"
4647 AU.addRequiredID(LoopSimplifyID);
4748 AU.addPreservedID(LoopSimplifyID);
4849 AU.addPreservedID(LCSSAID);
49 AU.addPreserved("scalar-evolution");
50 AU.addPreserved();
5051 AU.addRequired();
5152 }
5253 };
4545 void getAnalysisUsage(AnalysisUsage &AU) const override {
4646 // This is a cluster of orthogonal Transforms
4747 AU.addPreserved();
48 AU.addPreserved("mem2reg");
4948 AU.addPreservedID(LowerInvokePassID);
5049 }
5150
3434 // We preserve the non-critical-edgeness property
3535 AU.addPreservedID(BreakCriticalEdgesID);
3636 // This is a cluster of orthogonal Transforms
37 AU.addPreserved("mem2reg");
3837 AU.addPreservedID(LowerSwitchID);
3938 }
4039