summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-08 04:25:59 +0000
committerChris Lattner <sabre@nondot.org>2006-03-08 04:25:59 +0000
commit543832d39dad9da36c67da207d7bbe13458752db (patch)
treebb994514670817bfbfa797d91f2ed3846be8086d /llvm/lib/Target
parent237026555076a7169eab73f76ebb9b2eed2962a6 (diff)
downloadbcm5719-llvm-543832d39dad9da36c67da207d7bbe13458752db.tar.gz
bcm5719-llvm-543832d39dad9da36c67da207d7bbe13458752db.zip
Change the interface for getting a target HazardRecognizer to be more clean.
llvm-svn: 26608
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp10
-rw-r--r--llvm/lib/Target/PowerPC/PPCHazardRecognizers.h2
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp7
3 files changed, 8 insertions, 11 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp b/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp
index 852b9c8e32d..203f116135b 100644
--- a/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp
+++ b/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp
@@ -50,6 +50,10 @@ using namespace llvm;
// e.g. integer divides that only execute in the second slot.
//
+PPCHazardRecognizer970::PPCHazardRecognizer970() {
+ EndDispatchGroup();
+}
+
void PPCHazardRecognizer970::EndDispatchGroup() {
DEBUG(std::cerr << "=== Start of dispatch group\n");
// Pipeline units.
@@ -117,12 +121,6 @@ PPCHazardRecognizer970::GetInstrType(unsigned Opcode) {
return FXU;
}
-
-/// StartBasicBlock - Initiate a new dispatch group.
-void PPCHazardRecognizer970::StartBasicBlock() {
- EndDispatchGroup();
-}
-
/// isLoadOfStoredAddress - If we have a load from the previously stored pointer
/// as indicated by StorePtr1/StorePtr2/StoreSize, return true.
bool PPCHazardRecognizer970::
diff --git a/llvm/lib/Target/PowerPC/PPCHazardRecognizers.h b/llvm/lib/Target/PowerPC/PPCHazardRecognizers.h
index 5f7bb1bac26..fb1f88e0449 100644
--- a/llvm/lib/Target/PowerPC/PPCHazardRecognizers.h
+++ b/llvm/lib/Target/PowerPC/PPCHazardRecognizers.h
@@ -52,7 +52,7 @@ class PPCHazardRecognizer970 : public HazardRecognizer {
unsigned StoreSize;
public:
- virtual void StartBasicBlock();
+ PPCHazardRecognizer970();
virtual HazardType getHazardType(SDNode *Node);
virtual void EmitInstruction(SDNode *Node);
virtual void AdvanceCycle();
diff --git a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
index 5c74a7ba6cd..4c2d4af6f92 100644
--- a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
@@ -41,7 +41,6 @@ namespace {
class PPCDAGToDAGISel : public SelectionDAGISel {
PPCTargetLowering PPCLowering;
unsigned GlobalBaseReg;
- PPCHazardRecognizer970 PPC970HR;
public:
PPCDAGToDAGISel(TargetMachine &TM)
: SelectionDAGISel(PPCLowering), PPCLowering(TM) {}
@@ -125,12 +124,12 @@ namespace {
return "PowerPC DAG->DAG Pattern Instruction Selection";
}
- /// GetTargetHazardRecognizer - Return the hazard recognizer to use for this
+ /// CreateTargetHazardRecognizer - Return the hazard recognizer to use for this
/// target when scheduling the DAG.
- virtual HazardRecognizer &GetTargetHazardRecognizer() {
+ virtual HazardRecognizer *CreateTargetHazardRecognizer() {
// Should use subtarget info to pick the right hazard recognizer. For
// now, always return a PPC970 recognizer.
- return PPC970HR;
+ return new PPCHazardRecognizer970();
}
// Include the pieces autogenerated from the target description.
OpenPOWER on IntegriCloud