1 //===-- SPUHazardRecognizers.cpp - Cell Hazard Recognizer Impls -----------===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by a team from the Computer Systems Research
6 // Department at The Aerospace Corporation and is distributed under the
7 // University of Illinois Open Source License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 // This file implements hazard recognizers for scheduling on Cell SPU
14 //===----------------------------------------------------------------------===//
16 #define DEBUG_TYPE "sched"
18 #include "SPUHazardRecognizers.h"
20 #include "SPUInstrInfo.h"
21 #include "llvm/Support/Debug.h"
25 //===----------------------------------------------------------------------===//
26 // Cell SPU hazard recognizer
28 // This is the pipeline hazard recognizer for the Cell SPU processor. It does
29 // very little right now.
30 //===----------------------------------------------------------------------===//
32 SPUHazardRecognizer::SPUHazardRecognizer(const TargetInstrInfo &tii) :
38 /// Return the pipeline hazard type encountered or generated by this
39 /// instruction. Currently returns NoHazard.
42 HazardRecognizer::HazardType
43 SPUHazardRecognizer::getHazardType(SDNode *Node)
45 // Initial thoughts on how to do this, but this code cannot work unless the
46 // function's prolog and epilog code are also being scheduled so that we can
47 // accurately determine which pipeline is being scheduled.
49 HazardRecognizer::HazardType retval = NoHazard;
50 bool mustBeOdd = false;
52 switch (Node->getOpcode()) {
109 // Assume that this instruction can be on the even pipe
113 if (mustBeOdd && !EvenOdd)
116 DOUT << "SPUHazardRecognizer EvenOdd " << EvenOdd << " Hazard " << retval << "\n";
124 void SPUHazardRecognizer::EmitInstruction(SDNode *Node)
128 void SPUHazardRecognizer::AdvanceCycle()
130 DOUT << "SPUHazardRecognizer::AdvanceCycle\n";
133 void SPUHazardRecognizer::EmitNoop()