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 const ScheduleDAG
*DAG
) :
42 ScoreboardHazardRecognizer(ItinData
, DAG
, "post-RA-sched"), TII(tii
),
43 TRI(tri
), STI(sti
), LastMI(0), ITBlockSize(0) {}
45 virtual HazardType
getHazardType(SUnit
*SU
, int Stalls
);
47 virtual void EmitInstruction(SUnit
*SU
);
48 virtual void AdvanceCycle();
49 virtual void RecedeCycle();
52 } // end namespace llvm
54 #endif // ARMHAZARDRECOGNIZER_H