diff options
author | Tanya Lattner <tonic@nondot.org> | 2005-03-23 01:47:20 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2005-03-23 01:47:20 +0000 |
commit | 9532ab98392d28abd190c82f110cdadcf3068a59 (patch) | |
tree | 28d1eb044d0f1ed805132a9fbce000a8deed398f /lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h | |
parent | 2f72f9462b3fd0208d20cf7a213afd0e6b0c462d (diff) |
Added alias analysis.
Fixed many many bugs.
This now works on almost all Singlesource , and most of MultiSource.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20780 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h')
-rw-r--r-- | lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h b/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h index b2d9ccb9d2..b36c5b2c20 100644 --- a/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h +++ b/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.h @@ -17,6 +17,8 @@ #include "MSSchedule.h" #include "llvm/Function.h" #include "llvm/Pass.h" +#include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Target/TargetData.h" #include <set> namespace llvm { @@ -42,6 +44,9 @@ namespace llvm { //Map to hold Value* defs std::map<const Value*, MachineInstr*> defMap; + //Map to hold list of instructions associate to the induction var for each BB + std::map<const MachineBasicBlock*, std::map<const MachineInstr*, unsigned> > indVarInstrs; + //LLVM Instruction we know we can add TmpInstructions to its MCFI Instruction *defaultInst; @@ -69,6 +74,8 @@ namespace llvm { //Internal functions bool CreateDefMap(MachineBasicBlock *BI); bool MachineBBisValid(const MachineBasicBlock *BI); + bool assocIndVar(Instruction *I, std::set<Instruction*> &indVar, + std::vector<Instruction*> &stack, BasicBlock *BB); int calculateResMII(const MachineBasicBlock *BI); int calculateRecMII(MSchedGraph *graph, int MII); void calculateNodeAttributes(MSchedGraph *graph, int MII); @@ -101,9 +108,13 @@ namespace llvm { std::vector<MSchedGraphNode*> &path, std::set<MSchedGraphNode*> &nodesToAdd); + void pathToRecc(MSchedGraphNode *node, + std::vector<MSchedGraphNode*> &path, + std::set<MSchedGraphNode*> &poSet, std::set<MSchedGraphNode*> &lastNodes); + void computePartialOrder(); - bool computeSchedule(); + bool computeSchedule(const MachineBasicBlock *BB); bool scheduleNode(MSchedGraphNode *node, int start, int end); @@ -116,12 +127,12 @@ namespace llvm { void fixBranches(std::vector<MachineBasicBlock *> &prologues, std::vector<BasicBlock*> &llvm_prologues, MachineBasicBlock *machineBB, BasicBlock *llvmBB, std::vector<MachineBasicBlock *> &epilogues, std::vector<BasicBlock*> &llvm_epilogues, MachineBasicBlock*); - void writePrologues(std::vector<MachineBasicBlock *> &prologues, MachineBasicBlock *origBB, std::vector<BasicBlock*> &llvm_prologues, std::map<const Value*, std::pair<const MSchedGraphNode*, int> > &valuesToSave, std::map<Value*, std::map<int, Value*> > &newValues, std::map<Value*, MachineBasicBlock*> &newValLocation); + void writePrologues(std::vector<MachineBasicBlock *> &prologues, MachineBasicBlock *origBB, std::vector<BasicBlock*> &llvm_prologues, std::map<const Value*, std::pair<const MachineInstr*, int> > &valuesToSave, std::map<Value*, std::map<int, Value*> > &newValues, std::map<Value*, MachineBasicBlock*> &newValLocation); - void writeEpilogues(std::vector<MachineBasicBlock *> &epilogues, const MachineBasicBlock *origBB, std::vector<BasicBlock*> &llvm_epilogues, std::map<const Value*, std::pair<const MSchedGraphNode*, int> > &valuesToSave,std::map<Value*, std::map<int, Value*> > &newValues, std::map<Value*, MachineBasicBlock*> &newValLocation, std::map<Value*, std::map<int, Value*> > &kernelPHIs); + void writeEpilogues(std::vector<MachineBasicBlock *> &epilogues, const MachineBasicBlock *origBB, std::vector<BasicBlock*> &llvm_epilogues, std::map<const Value*, std::pair<const MachineInstr*, int> > &valuesToSave,std::map<Value*, std::map<int, Value*> > &newValues, std::map<Value*, MachineBasicBlock*> &newValLocation, std::map<Value*, std::map<int, Value*> > &kernelPHIs); - void writeKernel(BasicBlock *llvmBB, MachineBasicBlock *machineBB, std::map<const Value*, std::pair<const MSchedGraphNode*, int> > &valuesToSave, std::map<Value*, std::map<int, Value*> > &newValues, std::map<Value*, MachineBasicBlock*> &newValLocation, std::map<Value*, std::map<int, Value*> > &kernelPHIs); + void writeKernel(BasicBlock *llvmBB, MachineBasicBlock *machineBB, std::map<const Value*, std::pair<const MachineInstr*, int> > &valuesToSave, std::map<Value*, std::map<int, Value*> > &newValues, std::map<Value*, MachineBasicBlock*> &newValLocation, std::map<Value*, std::map<int, Value*> > &kernelPHIs); void removePHIs(const MachineBasicBlock *origBB, std::vector<MachineBasicBlock *> &prologues, std::vector<MachineBasicBlock *> &epilogues, MachineBasicBlock *kernelBB, std::map<Value*, MachineBasicBlock*> &newValLocation); @@ -131,6 +142,13 @@ namespace llvm { ModuloSchedulingPass(TargetMachine &targ) : target(targ) {} virtual bool runOnFunction(Function &F); virtual const char* getPassName() const { return "ModuloScheduling"; } + + // getAnalysisUsage + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired<AliasAnalysis>(); + AU.addRequired<TargetData>(); + } + }; } |