Remove refs to non-DebugLoc version of BuildMI from XCore, PIC16.
[oota-llvm.git] / lib / Target / PowerPC / PPCHazardRecognizers.cpp
index 717ce60e51dc25da5ccf50c07d057d91e427f7e1..e7658fc9d4ae31c51f4d9558101a73711ce44aae 100644 (file)
@@ -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;
 
@@ -72,7 +73,7 @@ PPCHazardRecognizer970::GetInstrType(unsigned Opcode,
   
   const TargetInstrDesc &TID = TII.get(Opcode);
   
-  isLoad  = TID.isSimpleLoad();
+  isLoad  = TID.mayLoad();
   isStore = TID.mayStore();
   
   unsigned TSFlags = TID.TSFlags;
@@ -86,7 +87,7 @@ PPCHazardRecognizer970::GetInstrType(unsigned Opcode,
 /// isLoadOfStoredAddress - If we have a load from the previously stored pointer
 /// as indicated by StorePtr1/StorePtr2/StoreSize, return true.
 bool PPCHazardRecognizer970::
-isLoadOfStoredAddress(unsigned LoadSize, SDOperand Ptr1, SDOperand Ptr2) const {
+isLoadOfStoredAddress(unsigned LoadSize, SDValue Ptr1, SDValue Ptr2) const {
   for (unsigned i = 0, e = NumStores; i != e; ++i) {
     // Handle exact and commuted addresses.
     if (Ptr1 == StorePtr1[i] && Ptr2 == StorePtr2[i])
@@ -101,8 +102,8 @@ isLoadOfStoredAddress(unsigned LoadSize, SDOperand Ptr1, SDOperand Ptr2) const {
         if (ConstantSDNode *LoadOffset = dyn_cast<ConstantSDNode>(Ptr1)) {
           // Okay the base pointers match, so we have [c1+r] vs [c2+r].  Check
           // to see if the load and store actually overlap.
-          int StoreOffs = StoreOffset->getValue();
-          int LoadOffs  = LoadOffset->getValue();
+          int StoreOffs = StoreOffset->getZExtValue();
+          int LoadOffs  = LoadOffset->getZExtValue();
           if (StoreOffs < LoadOffs) {
             if (int(StoreOffs+StoreSize[i]) > LoadOffs) return true;
           } else {
@@ -118,8 +119,9 @@ isLoadOfStoredAddress(unsigned LoadSize, SDOperand Ptr1, SDOperand 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,
@@ -299,7 +302,3 @@ void PPCHazardRecognizer970::AdvanceCycle() {
   if (NumIssued == 5)
     EndDispatchGroup();
 }
-
-void PPCHazardRecognizer970::EmitNoop() {
-  AdvanceCycle();
-}