1 //===-- ARMHazardRecognizer.h - ARM Hazard Recognizers ----------*- C++ -*-===//
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 defines hazard recognizers for scheduling ARM functions.
12 //===----------------------------------------------------------------------===//
14 #ifndef ARMHAZARDRECOGNIZER_H
15 #define ARMHAZARDRECOGNIZER_H
17 #include "llvm/CodeGen/ScoreboardHazardRecognizer.h"
21 class ARMBaseInstrInfo;
22 class ARMBaseRegisterInfo;
26 class ARMHazardRecognizer : public ScoreboardHazardRecognizer {
27 const ARMBaseInstrInfo &TII;
28 const ARMBaseRegisterInfo &TRI;
29 const ARMSubtarget &STI;
33 unsigned ITBlockSize; // No. of MIs in current IT block yet to be scheduled.
34 MachineInstr *ITBlockMIs[4];
37 ARMHazardRecognizer(const InstrItineraryData *ItinData,
38 const ARMBaseInstrInfo &tii,
39 const ARMBaseRegisterInfo &tri,
40 const ARMSubtarget &sti) :
41 ScoreboardHazardRecognizer(ItinData), TII(tii), TRI(tri), STI(sti),
42 LastMI(0), ITBlockSize(0) {}
44 virtual HazardType getHazardType(SUnit *SU);
46 virtual void EmitInstruction(SUnit *SU);
47 virtual void AdvanceCycle();
48 virtual void RecedeCycle();
51 } // end namespace llvm
53 #endif // ARMHAZARDRECOGNIZER_H