1 //===-- SPUHazardRecognizers.cpp - Cell Hazard Recognizer Impls -----------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements hazard recognizers for scheduling on Cell SPU
13 //===----------------------------------------------------------------------===//
15 #define DEBUG_TYPE "sched"
17 #include "SPUHazardRecognizers.h"
19 #include "SPUInstrInfo.h"
20 #include "llvm/Support/Debug.h"
24 //===----------------------------------------------------------------------===//
25 // Cell SPU hazard recognizer
27 // This is the pipeline hazard recognizer for the Cell SPU processor. It does
28 // very little right now.
29 //===----------------------------------------------------------------------===//
31 SPUHazardRecognizer::SPUHazardRecognizer(const TargetInstrInfo &tii) :
37 /// Return the pipeline hazard type encountered or generated by this
38 /// instruction. Currently returns NoHazard.
41 HazardRecognizer::HazardType
42 SPUHazardRecognizer::getHazardType(SDNode *Node)
44 // Initial thoughts on how to do this, but this code cannot work unless the
45 // function's prolog and epilog code are also being scheduled so that we can
46 // accurately determine which pipeline is being scheduled.
48 HazardRecognizer::HazardType retval = NoHazard;
49 bool mustBeOdd = false;
51 switch (Node->getOpcode()) {
108 // Assume that this instruction can be on the even pipe
112 if (mustBeOdd && !EvenOdd)
115 DOUT << "SPUHazardRecognizer EvenOdd " << EvenOdd << " Hazard " << retval << "\n";
123 void SPUHazardRecognizer::EmitInstruction(SDNode *Node)
127 void SPUHazardRecognizer::AdvanceCycle()
129 DOUT << "SPUHazardRecognizer::AdvanceCycle\n";
132 void SPUHazardRecognizer::EmitNoop()