From f60a149df6d6e10503e49075da455104eb489f5a Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Sun, 10 Oct 2004 23:33:20 +0000 Subject: ModuloScheduling moved to lib/Target/SparcV9 as it is SparcV9-specific git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16902 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/ModuloScheduling/ModuloScheduling.h | 112 ------------------------ 1 file changed, 112 deletions(-) delete mode 100644 lib/CodeGen/ModuloScheduling/ModuloScheduling.h (limited to 'lib/CodeGen/ModuloScheduling/ModuloScheduling.h') diff --git a/lib/CodeGen/ModuloScheduling/ModuloScheduling.h b/lib/CodeGen/ModuloScheduling/ModuloScheduling.h deleted file mode 100644 index d1376b702d..0000000000 --- a/lib/CodeGen/ModuloScheduling/ModuloScheduling.h +++ /dev/null @@ -1,112 +0,0 @@ -//===-- ModuloScheduling.h - Swing Modulo Scheduling------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file was developed by the LLVM research group and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_MODULOSCHEDULING_H -#define LLVM_MODULOSCHEDULING_H - -#include "MSchedGraph.h" -#include "MSSchedule.h" -#include "llvm/Function.h" -#include "llvm/Pass.h" -#include - -namespace llvm { - - - //Struct to contain ModuloScheduling Specific Information for each node - struct MSNodeAttributes { - int ASAP; //Earliest time at which the opreation can be scheduled - int ALAP; //Latest time at which the operation can be scheduled. - int MOB; - int depth; - int height; - MSNodeAttributes(int asap=-1, int alap=-1, int mob=-1, - int d=-1, int h=-1) : ASAP(asap), ALAP(alap), - MOB(mob), depth(d), - height(h) {} - }; - - - class ModuloSchedulingPass : public FunctionPass { - const TargetMachine ⌖ - - //Map that holds node to node attribute information - std::map nodeToAttributesMap; - - //Map to hold all reccurrences - std::set > > recurrenceList; - - //Set of edges to ignore, stored as src node and index into vector of successors - std::set > edgesToIgnore; - - //Vector containing the partial order - std::vector > partialOrder; - - //Vector containing the final node order - std::vector FinalNodeOrder; - - //Schedule table, key is the cycle number and the vector is resource, node pairs - MSSchedule schedule; - - //Current initiation interval - int II; - - //Internal functions - bool MachineBBisValid(const MachineBasicBlock *BI); - int calculateResMII(const MachineBasicBlock *BI); - int calculateRecMII(MSchedGraph *graph, int MII); - void calculateNodeAttributes(MSchedGraph *graph, int MII); - - bool ignoreEdge(MSchedGraphNode *srcNode, MSchedGraphNode *destNode); - - int calculateASAP(MSchedGraphNode *node, int MII,MSchedGraphNode *destNode); - int calculateALAP(MSchedGraphNode *node, int MII, int maxASAP, MSchedGraphNode *srcNode); - - int calculateHeight(MSchedGraphNode *node,MSchedGraphNode *srcNode); - int calculateDepth(MSchedGraphNode *node, MSchedGraphNode *destNode); - - int findMaxASAP(); - void orderNodes(); - void findAllReccurrences(MSchedGraphNode *node, - std::vector &visitedNodes, int II); - void addReccurrence(std::vector &recurrence, int II, MSchedGraphNode*, MSchedGraphNode*); - - void computePartialOrder(); - void computeSchedule(); - bool scheduleNode(MSchedGraphNode *node, - int start, int end); - - void predIntersect(std::vector &CurrentSet, std::vector &IntersectResult); - void succIntersect(std::vector &CurrentSet, std::vector &IntersectResult); - - void reconstructLoop(MachineBasicBlock*); - - //void saveValue(const MachineInstr*, const std::set&, std::vector*); - - void writePrologues(std::vector &prologues, MachineBasicBlock *origBB, std::vector &llvm_prologues, std::map > &valuesToSave, std::map > &newValues, std::map &newValLocation); - - void writeEpilogues(std::vector &epilogues, const MachineBasicBlock *origBB, std::vector &llvm_epilogues, std::map > &valuesToSave,std::map > &newValues, std::map &newValLocation, std::map > &kernelPHIs); - - - void writeKernel(BasicBlock *llvmBB, MachineBasicBlock *machineBB, std::map > &valuesToSave, std::map > &newValues, std::map &newValLocation, std::map > &kernelPHIs); - - void removePHIs(const MachineBasicBlock *origBB, std::vector &prologues, std::vector &epilogues, MachineBasicBlock *kernelBB, std::map &newValLocation); - - public: - ModuloSchedulingPass(TargetMachine &targ) : target(targ) {} - virtual bool runOnFunction(Function &F); - }; - -} - - -#endif -- cgit v1.2.3-18-g5258