aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorMehwish Nagda <nagda@cs.uiuc.edu>2002-07-25 17:31:05 +0000
committerMehwish Nagda <nagda@cs.uiuc.edu>2002-07-25 17:31:05 +0000
commite95ce74b80c5b366abfa1f67254219bf24b05ea3 (patch)
tree09ac7067a63f3ca317d430e9300d868cb87918dd /lib/Target
parent0009c2e8b38478eef745c777eafcca511cabc246 (diff)
downloadexternal_llvm-e95ce74b80c5b366abfa1f67254219bf24b05ea3.zip
external_llvm-e95ce74b80c5b366abfa1f67254219bf24b05ea3.tar.gz
external_llvm-e95ce74b80c5b366abfa1f67254219bf24b05ea3.tar.bz2
now removes deleted nops from MachineCodeForInstruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3090 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/SparcV9/InstrSched/InstrScheduling.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp
index 19c6922..39b3dd0 100644
--- a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp
+++ b/lib/Target/SparcV9/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