summaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCHazardRecognizers.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-01-15 22:18:12 +0000
committerDan Gohman <gohman@apple.com>2009-01-15 22:18:12 +0000
commitfc54c552963545a81e4ea38e60460590afb2d5ae (patch)
treebc07efaf419ac8d6edd959e8ff291c62d8ac6acd /lib/Target/PowerPC/PPCHazardRecognizers.cpp
parentc475c3608a5f0fc0c6bd43da04ae786649690070 (diff)
downloadllvm-fc54c552963545a81e4ea38e60460590afb2d5ae.tar.gz
llvm-fc54c552963545a81e4ea38e60460590afb2d5ae.tar.bz2
llvm-fc54c552963545a81e4ea38e60460590afb2d5ae.tar.xz
Generalize the HazardRecognizer interface so that it can be used
to support MachineInstr-based scheduling in addition to SDNode-based scheduling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62284 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCHazardRecognizers.cpp')
-rw-r--r--lib/Target/PowerPC/PPCHazardRecognizers.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Target/PowerPC/PPCHazardRecognizers.cpp b/lib/Target/PowerPC/PPCHazardRecognizers.cpp
index 14745e61e1..d8a21bf38b 100644
--- a/lib/Target/PowerPC/PPCHazardRecognizers.cpp
+++ b/lib/Target/PowerPC/PPCHazardRecognizers.cpp
@@ -15,6 +15,7 @@
#include "PPCHazardRecognizers.h"
#include "PPC.h"
#include "PPCInstrInfo.h"
+#include "llvm/CodeGen/ScheduleDAG.h"
#include "llvm/Support/Debug.h"
using namespace llvm;
@@ -118,8 +119,9 @@ isLoadOfStoredAddress(unsigned LoadSize, SDValue Ptr1, SDValue Ptr2) const {
/// terminate terminate the dispatch group. We turn NoopHazard for any
/// instructions that wouldn't terminate the dispatch group that would cause a
/// pipeline flush.
-HazardRecognizer::HazardType PPCHazardRecognizer970::
-getHazardType(SDNode *Node) {
+ScheduleHazardRecognizer::HazardType PPCHazardRecognizer970::
+getHazardType(SUnit *SU) {
+ const SDNode *Node = SU->getNode()->getFlaggedMachineNode();
bool isFirst, isSingle, isCracked, isLoad, isStore;
PPCII::PPC970_Unit InstrType =
GetInstrType(Node->getOpcode(), isFirst, isSingle, isCracked,
@@ -217,7 +219,8 @@ getHazardType(SDNode *Node) {
return NoHazard;
}
-void PPCHazardRecognizer970::EmitInstruction(SDNode *Node) {
+void PPCHazardRecognizer970::EmitInstruction(SUnit *SU) {
+ const SDNode *Node = SU->getNode()->getFlaggedMachineNode();
bool isFirst, isSingle, isCracked, isLoad, isStore;
PPCII::PPC970_Unit InstrType =
GetInstrType(Node->getOpcode(), isFirst, isSingle, isCracked,