Instead of using isDummyPhiInstr, we just compare the opcode with V9::PHI.
authorBrian Gaeke <gaeke@uiuc.edu>
Wed, 18 Aug 2004 20:04:24 +0000 (20:04 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Wed, 18 Aug 2004 20:04:24 +0000 (20:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15906 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/InstrSched/SchedGraph.cpp
lib/CodeGen/ModuloScheduling/ModuloScheduling.cpp
lib/Target/SparcV9/InstrSched/SchedGraph.cpp
lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp
lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
lib/Target/SparcV9/SparcV9AsmPrinter.cpp

index 03771fe01d17cba4cbaf366636257db29d6e0301..e3b3cba5249d1d4031a61f0905868d79181574b8 100644 (file)
@@ -21,6 +21,7 @@
 #include "llvm/Target/TargetMachine.h"
 #include "../../Target/SparcV9/MachineCodeForInstruction.h"
 #include "../../Target/SparcV9/SparcV9RegInfo.h"
+#include "../../Target/SparcV9/SparcV9InstrInfo.h"
 #include "Support/STLExtras.h"
 #include <iostream>
 
@@ -561,7 +562,7 @@ void SchedGraph::buildNodesForBB(const TargetMachine& target,
   unsigned i = 0;
   for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E;
        ++I, ++i)
-    if (!mii.isDummyPhiInstr(I->getOpcode())) {
+    if (I->getOpcode() != V9::PHI) {
       SchedGraphNode* node = new SchedGraphNode(getNumNodes(), &MBB, i, target);
       noteGraphNodeForInstr(I, node);
       
index 8e11dd1da5c3eae2cf0eb93aab4b3badb896fac7..dadc38570c63a9ddeb97a42bca8064454521c336 100644 (file)
@@ -1444,8 +1444,7 @@ void ModuloSchedulingPass::removePHIs(const MachineBasicBlock *origBB, std::vect
   //Start with the kernel and for each phi insert a copy for the phi def and for each arg
   for(MachineBasicBlock::iterator I = kernelBB->begin(), E = kernelBB->end(); I != E; ++I) {
     //Get op code and check if its a phi
-     MachineOpCode OC = I->getOpcode();
-     if(TMI->isDummyPhiInstr(OC)) {
+     if(I->getOpcode() == V9::PHI) {
        Instruction *tmp = 0;
        for(unsigned i = 0; i < I->getNumOperands(); ++i) {
         //Get Operand
@@ -1491,8 +1490,7 @@ void ModuloSchedulingPass::removePHIs(const MachineBasicBlock *origBB, std::vect
   for(std::vector<MachineBasicBlock*>::iterator MB = epilogues.begin(), ME = epilogues.end(); MB != ME; ++MB) {
     for(MachineBasicBlock::iterator I = (*MB)->begin(), E = (*MB)->end(); I != E; ++I) {
       //Get op code and check if its a phi
-      MachineOpCode OC = I->getOpcode();
-      if(TMI->isDummyPhiInstr(OC)) {
+      if(I->getOpcode() == V9::PHI) {
        Instruction *tmp = 0;
        for(unsigned i = 0; i < I->getNumOperands(); ++i) {
          //Get Operand
index 03771fe01d17cba4cbaf366636257db29d6e0301..e3b3cba5249d1d4031a61f0905868d79181574b8 100644 (file)
@@ -21,6 +21,7 @@
 #include "llvm/Target/TargetMachine.h"
 #include "../../Target/SparcV9/MachineCodeForInstruction.h"
 #include "../../Target/SparcV9/SparcV9RegInfo.h"
+#include "../../Target/SparcV9/SparcV9InstrInfo.h"
 #include "Support/STLExtras.h"
 #include <iostream>
 
@@ -561,7 +562,7 @@ void SchedGraph::buildNodesForBB(const TargetMachine& target,
   unsigned i = 0;
   for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E;
        ++I, ++i)
-    if (!mii.isDummyPhiInstr(I->getOpcode())) {
+    if (I->getOpcode() != V9::PHI) {
       SchedGraphNode* node = new SchedGraphNode(getNumNodes(), &MBB, i, target);
       noteGraphNodeForInstr(I, node);
       
index 8e11dd1da5c3eae2cf0eb93aab4b3badb896fac7..dadc38570c63a9ddeb97a42bca8064454521c336 100644 (file)
@@ -1444,8 +1444,7 @@ void ModuloSchedulingPass::removePHIs(const MachineBasicBlock *origBB, std::vect
   //Start with the kernel and for each phi insert a copy for the phi def and for each arg
   for(MachineBasicBlock::iterator I = kernelBB->begin(), E = kernelBB->end(); I != E; ++I) {
     //Get op code and check if its a phi
-     MachineOpCode OC = I->getOpcode();
-     if(TMI->isDummyPhiInstr(OC)) {
+     if(I->getOpcode() == V9::PHI) {
        Instruction *tmp = 0;
        for(unsigned i = 0; i < I->getNumOperands(); ++i) {
         //Get Operand
@@ -1491,8 +1490,7 @@ void ModuloSchedulingPass::removePHIs(const MachineBasicBlock *origBB, std::vect
   for(std::vector<MachineBasicBlock*>::iterator MB = epilogues.begin(), ME = epilogues.end(); MB != ME; ++MB) {
     for(MachineBasicBlock::iterator I = (*MB)->begin(), E = (*MB)->end(); I != E; ++I) {
       //Get op code and check if its a phi
-      MachineOpCode OC = I->getOpcode();
-      if(TMI->isDummyPhiInstr(OC)) {
+      if(I->getOpcode() == V9::PHI) {
        Instruction *tmp = 0;
        for(unsigned i = 0; i < I->getNumOperands(); ++i) {
          //Get Operand
index 2fd8e558fdc7d7773e19dd1a5e3e9a3d20463e23..02f18fc7389fc2f881e265f6c6a97c53a38cd50a 100644 (file)
@@ -484,7 +484,7 @@ void PhyRegAlloc::updateMachineCode()
     // their assigned registers or insert spill code, as appropriate. 
     // Also, fix operands of call/return instructions.
     for (MachineBasicBlock::iterator MII = MBB.begin(); MII != MBB.end(); ++MII)
-      if (! TM.getInstrInfo()->isDummyPhiInstr(MII->getOpcode()))
+      if (MII->getOpcode() != V9::PHI)
         updateInstruction(MII, MBB);
 
     // Now, move code out of delay slots of branches and returns if needed.
@@ -552,7 +552,7 @@ void PhyRegAlloc::updateMachineCode()
       MachineInstr *MInst = MII; 
 
       // do not process Phis
-      if (TM.getInstrInfo()->isDummyPhiInstr(MInst->getOpcode()))
+      if (MInst->getOpcode() == V9::PHI)
        continue;
 
       // if there are any added instructions...
index 58f589d485d9de2d82c611c0cce368935c993f78..36deae09d82b796d0006a6647aa4f6c28ca97144 100644 (file)
@@ -283,8 +283,8 @@ SparcV9AsmPrinter::printOneOperand(const MachineOperand &mop,
 void SparcV9AsmPrinter::emitMachineInst(const MachineInstr *MI) {
   unsigned Opcode = MI->getOpcode();
 
-  if (TM.getInstrInfo()->isDummyPhiInstr(Opcode))
-    return;  // IGNORE PHI NODES
+  if (Opcode == V9::PHI)
+    return;  // Ignore Machine-PHI nodes.
 
   O << "\t" << TM.getInstrInfo()->getName(Opcode) << "\t";