blob: a8198e26703e4e969e7a21fd5470d01cbc4599df [file] [log] [blame]
Evan Cheng62c7b5b2010-12-05 22:04:16 +00001//===-- ARMHazardRecognizer.h - ARM Hazard Recognizers ----------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines hazard recognizers for scheduling ARM functions.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef ARMHAZARDRECOGNIZER_H
15#define ARMHAZARDRECOGNIZER_H
16
Andrew Trick00067fb2010-12-08 20:04:29 +000017#include "llvm/CodeGen/ScoreboardHazardRecognizer.h"
Evan Cheng62c7b5b2010-12-05 22:04:16 +000018
19namespace llvm {
20
21class ARMBaseInstrInfo;
22class ARMBaseRegisterInfo;
23class ARMSubtarget;
24class MachineInstr;
25
Andrew Trick312b97c2011-11-29 19:33:49 +000026/// ARMHazardRecognizer handles special constraints that are not expressed in
27/// the scheduling itinerary. This is only used during postRA scheduling. The
28/// ARM preRA scheduler uses an unspecialized instance of the
29/// ScoreboardHazardRecognizer.
Andrew Trick00067fb2010-12-08 20:04:29 +000030class ARMHazardRecognizer : public ScoreboardHazardRecognizer {
Evan Cheng62c7b5b2010-12-05 22:04:16 +000031 MachineInstr *LastMI;
Andrew Trick10ffc2b2010-12-24 05:03:26 +000032 unsigned FpMLxStalls;
Evan Cheng62c7b5b2010-12-05 22:04:16 +000033
34public:
35 ARMHazardRecognizer(const InstrItineraryData *ItinData,
Bill Wendlingf95178e2013-06-07 05:54:19 +000036 const ScheduleDAG *DAG)
37 : ScoreboardHazardRecognizer(ItinData, DAG, "post-RA-sched"),
Craig Toppere73658d2014-04-28 04:05:08 +000038 LastMI(nullptr) {}
Evan Cheng62c7b5b2010-12-05 22:04:16 +000039
Craig Topper6bc27bf2014-03-10 02:09:33 +000040 HazardType getHazardType(SUnit *SU, int Stalls) override;
41 void Reset() override;
42 void EmitInstruction(SUnit *SU) override;
43 void AdvanceCycle() override;
44 void RecedeCycle() override;
Evan Cheng62c7b5b2010-12-05 22:04:16 +000045};
46
Evan Cheng62c7b5b2010-12-05 22:04:16 +000047} // end namespace llvm
48
49#endif // ARMHAZARDRECOGNIZER_H