diff options
author | Mehwish Nagda <nagda@cs.uiuc.edu> | 2002-07-25 17:31:05 +0000 |
---|---|---|
committer | Mehwish Nagda <nagda@cs.uiuc.edu> | 2002-07-25 17:31:05 +0000 |
commit | 7a167de8511ad151e248f8f2adeb273e9c181382 (patch) | |
tree | 74b89ba0db5ae3df4ed256f5b86cb85670048b16 /llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp | |
parent | 26c7e5839e4934e2d4af5f2e8dd17e9141ec67d0 (diff) | |
download | bcm5719-llvm-7a167de8511ad151e248f8f2adeb273e9c181382.tar.gz bcm5719-llvm-7a167de8511ad151e248f8f2adeb273e9c181382.zip |
now removes deleted nops from MachineCodeForInstruction
llvm-svn: 3090
Diffstat (limited to 'llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp')
-rw-r--r-- | llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp b/llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp index 19c6922d342..39b3dd06788 100644 --- a/llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp +++ b/llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp @@ -79,7 +79,7 @@ private: //---------------------------------------------------------------------- template<class _NodeType> -class ScheduleIterator : public forward_iterator<_NodeType, ptrdiff_t> { +class ScheduleIterator: public std::forward_iterator<_NodeType, ptrdiff_t> { private: unsigned cycleNum; unsigned slotNum; @@ -352,18 +352,18 @@ private: unsigned int totalInstrCount; cycles_t curTime; cycles_t nextEarliestIssueTime; // next cycle we can issue - vector<hash_set<const SchedGraphNode*> > choicesForSlot; // indexed by slot# + vector<std::hash_set<const SchedGraphNode*> > choicesForSlot; // indexed by slot# vector<const SchedGraphNode*> choiceVec; // indexed by node ptr vector<int> numInClass; // indexed by sched class vector<cycles_t> nextEarliestStartTime; // indexed by opCode - hash_map<const SchedGraphNode*, DelaySlotInfo*> delaySlotInfoForBranches; + std::hash_map<const SchedGraphNode*, DelaySlotInfo*> delaySlotInfoForBranches; // indexed by branch node ptr public: SchedulingManager(const TargetMachine& _target, const SchedGraph* graph, SchedPriorities& schedPrio); ~SchedulingManager() { - for (hash_map<const SchedGraphNode*, + for (std::hash_map<const SchedGraphNode*, DelaySlotInfo*>::iterator I = delaySlotInfoForBranches.begin(), E = delaySlotInfoForBranches.end(); I != E; ++I) delete I->second; @@ -422,7 +422,7 @@ public: return choiceVec[i]; } - inline hash_set<const SchedGraphNode*>& getChoicesForSlot(unsigned slotNum) { + inline std::hash_set<const SchedGraphNode*>& getChoicesForSlot(unsigned slotNum) { assert(slotNum < nslots); return choicesForSlot[slotNum]; } @@ -497,7 +497,7 @@ public: inline DelaySlotInfo* getDelaySlotInfoForInstr(const SchedGraphNode* bn, bool createIfMissing=false) { - hash_map<const SchedGraphNode*, DelaySlotInfo*>::const_iterator + std::hash_map<const SchedGraphNode*, DelaySlotInfo*>::const_iterator I = delaySlotInfoForBranches.find(bn); if (I != delaySlotInfoForBranches.end()) return I->second; @@ -1243,8 +1243,20 @@ ReplaceNopsWithUsefulInstr(SchedulingManager& S, if (sdelayNodeVec.size() < ndelays) sdelayNodeVec.push_back(graph->getGraphNodeForInstr(bbMvec[i])); else - nopNodeVec.push_back(graph->getGraphNodeForInstr(bbMvec[i])); - + { + nopNodeVec.push_back(graph->getGraphNodeForInstr(bbMvec[i])); + + //remove the MI from the Machine Code For Instruction + MachineCodeForInstruction& llvmMvec = + MachineCodeForInstruction::get((Instruction *) + (node->getBB()->getTerminator())); + for(MachineCodeForInstruction::iterator mciI=llvmMvec.begin(), + mciE=llvmMvec.end(); mciI!=mciE; ++mciI){ + if(*mciI==bbMvec[i]) + llvmMvec.erase(mciI); + } + } + assert(sdelayNodeVec.size() >= ndelays); // If some delay slots were already filled, throw away that many new choices |