summaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/DFAPacketizer.h
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-05-03 16:50:55 +0000
committerdim <dim@FreeBSD.org>2012-05-03 16:50:55 +0000
commit2c5e9d71aba3b1a85f07c08d2c09d40b8547264b (patch)
tree8575c732129e272992ac5d7b4c2519238fff4735 /include/llvm/CodeGen/DFAPacketizer.h
parent1fc08f5e9ef733ef1ce6f363fecedc2260e78974 (diff)
downloadFreeBSD-src-2c5e9d71aba3b1a85f07c08d2c09d40b8547264b.zip
FreeBSD-src-2c5e9d71aba3b1a85f07c08d2c09d40b8547264b.tar.gz
Vendor import of llvm release_31 branch r155985:
http://llvm.org/svn/llvm-project/llvm/branches/release_31@155985
Diffstat (limited to 'include/llvm/CodeGen/DFAPacketizer.h')
-rw-r--r--include/llvm/CodeGen/DFAPacketizer.h44
1 files changed, 12 insertions, 32 deletions
diff --git a/include/llvm/CodeGen/DFAPacketizer.h b/include/llvm/CodeGen/DFAPacketizer.h
index 2d2db78..ee1ed07 100644
--- a/include/llvm/CodeGen/DFAPacketizer.h
+++ b/include/llvm/CodeGen/DFAPacketizer.h
@@ -28,7 +28,6 @@
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/ADT/DenseMap.h"
-#include <map>
namespace llvm {
@@ -37,7 +36,7 @@ class MachineInstr;
class MachineLoopInfo;
class MachineDominatorTree;
class InstrItineraryData;
-class DefaultVLIWScheduler;
+class ScheduleDAGInstrs;
class SUnit;
class DFAPacketizer {
@@ -78,8 +77,6 @@ public:
// reserveResources - Reserve the resources occupied by a machine
// instruction and change the current state to reflect that change.
void reserveResources(llvm::MachineInstr *MI);
-
- const InstrItineraryData *getInstrItins() const { return InstrItins; }
};
// VLIWPacketizerList - Implements a simple VLIW packetizer using DFA. The
@@ -90,21 +87,20 @@ public:
// and machine resource is marked as taken. If any dependency is found, a target
// API call is made to prune the dependence.
class VLIWPacketizerList {
-protected:
const TargetMachine &TM;
const MachineFunction &MF;
const TargetInstrInfo *TII;
- // The VLIW Scheduler.
- DefaultVLIWScheduler *VLIWScheduler;
+ // Encapsulate data types not exposed to the target interface.
+ ScheduleDAGInstrs *SchedulerImpl;
+protected:
// Vector of instructions assigned to the current packet.
std::vector<MachineInstr*> CurrentPacketMIs;
// DFA resource tracker.
DFAPacketizer *ResourceTracker;
-
- // Generate MI -> SU map.
- std::map<MachineInstr*, SUnit*> MIToSUnit;
+ // Scheduling units.
+ std::vector<SUnit> SUnits;
public:
VLIWPacketizerList(
@@ -122,32 +118,17 @@ public:
DFAPacketizer *getResourceTracker() {return ResourceTracker;}
// addToPacket - Add MI to the current packet.
- virtual MachineBasicBlock::iterator addToPacket(MachineInstr *MI) {
- MachineBasicBlock::iterator MII = MI;
- CurrentPacketMIs.push_back(MI);
- ResourceTracker->reserveResources(MI);
- return MII;
- }
+ void addToPacket(MachineInstr *MI);
// endPacket - End the current packet.
- void endPacket(MachineBasicBlock *MBB, MachineInstr *MI);
-
- // initPacketizerState - perform initialization before packetizing
- // an instruction. This function is supposed to be overrided by
- // the target dependent packetizer.
- virtual void initPacketizerState(void) { return; }
+ void endPacket(MachineBasicBlock *MBB, MachineInstr *I);
// ignorePseudoInstruction - Ignore bundling of pseudo instructions.
- virtual bool ignorePseudoInstruction(MachineInstr *I,
- MachineBasicBlock *MBB) {
- return false;
- }
+ bool ignorePseudoInstruction(MachineInstr *I, MachineBasicBlock *MBB);
- // isSoloInstruction - return true if instruction MI can not be packetized
- // with any other instruction, which means that MI itself is a packet.
- virtual bool isSoloInstruction(MachineInstr *MI) {
- return true;
- }
+ // isSoloInstruction - return true if instruction I must end previous
+ // packet.
+ bool isSoloInstruction(MachineInstr *I);
// isLegalToPacketizeTogether - Is it legal to packetize SUI and SUJ
// together.
@@ -160,7 +141,6 @@ public:
virtual bool isLegalToPruneDependencies(SUnit *SUI, SUnit *SUJ) {
return false;
}
-
};
}
OpenPOWER on IntegriCloud