llvm.org GIT mirror llvm / 09ff112
*** empty log message *** git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3056 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 18 years ago
19 changed file(s) with 32 addition(s) and 35 deletion(s). Raw diff Collapse all Expand all
1111 #include "llvm/Annotation.h"
1212 #include "Support/NonCopyable.h"
1313 #include "Support/HashExtras.h"
14 #include <ext/hash_set>
14 #include <Support/hash_set>
1515 class Value;
1616 class Function;
1717 class Constant;
1111 #include "llvm/Annotation.h"
1212 #include "Support/NonCopyable.h"
1313 #include "Support/HashExtras.h"
14 #include <ext/hash_set>
14 #include <Support/hash_set>
1515 class Value;
1616 class Function;
1717 class Constant;
1111 #include "llvm/Target/MachineInstrInfo.h"
1212 #include "llvm/Annotation.h"
1313 #include
14 #include <ext/hash_set>
14 #include <Support/hash_set>
1515 class Instruction;
1616 using std::vector;
17 using std::hash_set;
1817
1918 //---------------------------------------------------------------------------
2019 // class MachineOperand
88 #define LLVM_TARGET_MACHINEREGINFO_H
99
1010 #include "Support/NonCopyable.h"
11 #include <ext/hash_map>
11 #include <Support/hash_map>
1212 #include
1313
1414 class TargetMachine;
66 #ifndef LLVM_TARGET_MACHINESCHEDINFO_H
77 #define LLVM_TARGET_MACHINESCHEDINFO_H
88
9 #include
109 #include "llvm/Target/MachineInstrInfo.h"
10 #include
1111
1212 typedef long long cycles_t;
1313 static const cycles_t HUGE_LATENCY = ~((long long) 1 << (sizeof(cycles_t)-2));
351351 unsigned int totalInstrCount;
352352 cycles_t curTime;
353353 cycles_t nextEarliestIssueTime; // next cycle we can issue
354 vector<std::hash_set > choicesForSlot; // indexed by slot#
354 vector<hash_set > choicesForSlot; // indexed by slot#
355355 vector choiceVec; // indexed by node ptr
356356 vector numInClass; // indexed by sched class
357357 vector nextEarliestStartTime; // indexed by opCode
358 std::hash_map delaySlotInfoForBranches;
358 hash_map delaySlotInfoForBranches;
359359 // indexed by branch node ptr
360360
361361 public:
362362 SchedulingManager(const TargetMachine& _target, const SchedGraph* graph,
363363 SchedPriorities& schedPrio);
364364 ~SchedulingManager() {
365 for (std::hash_map
365 for (hash_map
366366 DelaySlotInfo*>::iterator I = delaySlotInfoForBranches.begin(),
367367 E = delaySlotInfoForBranches.end(); I != E; ++I)
368368 delete I->second;
421421 return choiceVec[i];
422422 }
423423
424 inline std::hash_set& getChoicesForSlot(unsigned slotNum) {
424 inline hash_set& getChoicesForSlot(unsigned slotNum) {
425425 assert(slotNum < nslots);
426426 return choicesForSlot[slotNum];
427427 }
496496 inline DelaySlotInfo* getDelaySlotInfoForInstr(const SchedGraphNode* bn,
497497 bool createIfMissing=false)
498498 {
499 std::hash_map::const_iterator
499 hash_map::const_iterator
500500 I = delaySlotInfoForBranches.find(bn);
501501 if (I != delaySlotInfoForBranches.end())
502502 return I->second;
2626
2727 using std::vector;
2828 using std::pair;
29 using std::hash_map;
3029 using std::cerr;
3130
3231 //*********************** Internal Data Structures *************************/
210210
211211 class SchedGraph :
212212 public NonCopyable,
213 private std::hash_map
213 private hash_map
214214 {
215215 private:
216216 std::vector bbVec; // basic blocks included in the graph
217217 SchedGraphNode* graphRoot; // the root and leaf are not inserted
218218 SchedGraphNode* graphLeaf; // in the hash_map (see getNumNodes())
219219
220 typedef std::hash_map map_base;
220 typedef hash_map map_base;
221221 public:
222222 using map_base::iterator;
223223 using map_base::const_iterator;
269269 const SchedGraphNode* graphNode) {
270270 const MachineInstr *MI = graphNode->getMachineInstr();
271271
272 std::hash_map::const_iterator
272 hash_map::const_iterator
273273 ui = lastUseMap.find(MI);
274274 if (ui != lastUseMap.end())
275275 return ui->second;
2424 #include "llvm/CodeGen/InstrScheduling.h"
2525 #include "llvm/Target/MachineSchedInfo.h"
2626 #include
27 #include <ext/hash_set>
27 #include <Support/hash_set>
2828 #include
2929 class Function;
3030 class MachineInstr;
265265 int
266266 MachineCodeForMethod::getOffset(const Value* val) const
267267 {
268 std::hash_map::const_iterator pair = offsets.find(val);
268 hash_map::const_iterator pair = offsets.find(val);
269269 return (pair == offsets.end())? INVALID_FRAME_OFFSET : pair->second;
270270 }
271271
351351 unsigned int totalInstrCount;
352352 cycles_t curTime;
353353 cycles_t nextEarliestIssueTime; // next cycle we can issue
354 vector<std::hash_set > choicesForSlot; // indexed by slot#
354 vector<hash_set > choicesForSlot; // indexed by slot#
355355 vector choiceVec; // indexed by node ptr
356356 vector numInClass; // indexed by sched class
357357 vector nextEarliestStartTime; // indexed by opCode
358 std::hash_map delaySlotInfoForBranches;
358 hash_map delaySlotInfoForBranches;
359359 // indexed by branch node ptr
360360
361361 public:
362362 SchedulingManager(const TargetMachine& _target, const SchedGraph* graph,
363363 SchedPriorities& schedPrio);
364364 ~SchedulingManager() {
365 for (std::hash_map
365 for (hash_map
366366 DelaySlotInfo*>::iterator I = delaySlotInfoForBranches.begin(),
367367 E = delaySlotInfoForBranches.end(); I != E; ++I)
368368 delete I->second;
421421 return choiceVec[i];
422422 }
423423
424 inline std::hash_set& getChoicesForSlot(unsigned slotNum) {
424 inline hash_set& getChoicesForSlot(unsigned slotNum) {
425425 assert(slotNum < nslots);
426426 return choicesForSlot[slotNum];
427427 }
496496 inline DelaySlotInfo* getDelaySlotInfoForInstr(const SchedGraphNode* bn,
497497 bool createIfMissing=false)
498498 {
499 std::hash_map::const_iterator
499 hash_map::const_iterator
500500 I = delaySlotInfoForBranches.find(bn);
501501 if (I != delaySlotInfoForBranches.end())
502502 return I->second;
2626
2727 using std::vector;
2828 using std::pair;
29 using std::hash_map;
3029 using std::cerr;
3130
3231 //*********************** Internal Data Structures *************************/
210210
211211 class SchedGraph :
212212 public NonCopyable,
213 private std::hash_map
213 private hash_map
214214 {
215215 private:
216216 std::vector bbVec; // basic blocks included in the graph
217217 SchedGraphNode* graphRoot; // the root and leaf are not inserted
218218 SchedGraphNode* graphLeaf; // in the hash_map (see getNumNodes())
219219
220 typedef std::hash_map map_base;
220 typedef hash_map map_base;
221221 public:
222222 using map_base::iterator;
223223 using map_base::const_iterator;
269269 const SchedGraphNode* graphNode) {
270270 const MachineInstr *MI = graphNode->getMachineInstr();
271271
272 std::hash_map::const_iterator
272 hash_map::const_iterator
273273 ui = lastUseMap.find(MI);
274274 if (ui != lastUseMap.end())
275275 return ui->second;
2424 #include "llvm/CodeGen/InstrScheduling.h"
2525 #include "llvm/Target/MachineSchedInfo.h"
2626 #include
27 #include <ext/hash_set>
27 #include <Support/hash_set>
2828 #include
2929 class Function;
3030 class MachineInstr;
3333 static AnnotationID AnnotId;
3434 friend class AsmPrinter; // give access to AnnotId
3535
36 typedef std::hash_map ValIdMap;
36 typedef hash_map ValIdMap;
3737 typedef ValIdMap::const_iterator ValIdMapConstIterator;
3838 typedef ValIdMap:: iterator ValIdMapIterator;
3939 public:
473473 void printConstant( const Constant* CV, std::string valID = "");
474474
475475 static void FoldConstants(const Module &M,
476 std::hash_set &moduleConstants);
476 hash_set &moduleConstants);
477477 };
478478
479479
740740
741741
742742 void SparcModuleAsmPrinter::FoldConstants(const Module &M,
743 std::hash_set &MC) {
743 hash_set &MC) {
744744 for (Module::const_iterator I = M.begin(), E = M.end(); I != E; ++I)
745745 if (!I->isExternal()) {
746 const std::hash_set &pool =
746 const hash_set &pool =
747747 MachineCodeForMethod::get(I).getConstantPoolValues();
748748 MC.insert(pool.begin(), pool.end());
749749 }
773773 // lets force these constants into the slot table so that we can get
774774 // unique names for unnamed constants also.
775775 //
776 std::hash_set moduleConstants;
776 hash_set moduleConstants;
777777 FoldConstants(M, moduleConstants);
778778
779779 // Now, emit the three data sections separately; the cost of I/O should
785785 if (GI->hasInitializer() && GI->isConstant())
786786 printGlobalVariable(GI);
787787
788 for (std::hash_set::const_iterator
788 for (hash_set::const_iterator
789789 I = moduleConstants.begin(),
790790 E = moduleConstants.end(); I != E; ++I)
791791 printConstant(*I);
147147 static TmpInstruction*
148148 GetTmpForCC(Value* boolVal, const Function *F, const Type* ccType)
149149 {
150 typedef std::hash_map BoolTmpCache;
150 typedef hash_map BoolTmpCache;
151151 static BoolTmpCache boolToTmpCache; // Map boolVal -> TmpInstruction*
152152 static const Function *lastFunction = 0;// Use to flush cache between funcs
153153
13161316
13171317 // has set to record which registers were saved/restored
13181318 //
1319 std::hash_set PushedRegSet;
1319 hash_set PushedRegSet;
13201320
13211321 CallArgsDescriptor* argDesc = CallArgsDescriptor::get(CallMI);
13221322