blob: b5ac694e01f72d179f1e876bfd26a5d59ef4e1ea [file] [log] [blame]
Evan Cheng62c7b5b2010-12-05 22:04:16 +00001//===-- ARMHazardRecognizer.h - ARM Hazard Recognizers ----------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Evan Cheng62c7b5b2010-12-05 22:04:16 +00006//
7//===----------------------------------------------------------------------===//
8//
9// This file defines hazard recognizers for scheduling ARM functions.
10//
11//===----------------------------------------------------------------------===//
12
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000013#ifndef LLVM_LIB_TARGET_ARM_ARMHAZARDRECOGNIZER_H
14#define LLVM_LIB_TARGET_ARM_ARMHAZARDRECOGNIZER_H
Evan Cheng62c7b5b2010-12-05 22:04:16 +000015
Andrew Trick00067fb2010-12-08 20:04:29 +000016#include "llvm/CodeGen/ScoreboardHazardRecognizer.h"
Evan Cheng62c7b5b2010-12-05 22:04:16 +000017
18namespace llvm {
19
20class ARMBaseInstrInfo;
21class ARMBaseRegisterInfo;
22class ARMSubtarget;
23class MachineInstr;
24
Andrew Trick312b97c2011-11-29 19:33:49 +000025/// ARMHazardRecognizer handles special constraints that are not expressed in
26/// the scheduling itinerary. This is only used during postRA scheduling. The
27/// ARM preRA scheduler uses an unspecialized instance of the
28/// ScoreboardHazardRecognizer.
Andrew Trick00067fb2010-12-08 20:04:29 +000029class ARMHazardRecognizer : public ScoreboardHazardRecognizer {
Evan Cheng62c7b5b2010-12-05 22:04:16 +000030 MachineInstr *LastMI;
Andrew Trick10ffc2b2010-12-24 05:03:26 +000031 unsigned FpMLxStalls;
Evan Cheng62c7b5b2010-12-05 22:04:16 +000032
33public:
34 ARMHazardRecognizer(const InstrItineraryData *ItinData,
Bill Wendlingf95178e2013-06-07 05:54:19 +000035 const ScheduleDAG *DAG)
36 : ScoreboardHazardRecognizer(ItinData, DAG, "post-RA-sched"),
Craig Toppere73658d2014-04-28 04:05:08 +000037 LastMI(nullptr) {}
Evan Cheng62c7b5b2010-12-05 22:04:16 +000038
Craig Topper6bc27bf2014-03-10 02:09:33 +000039 HazardType getHazardType(SUnit *SU, int Stalls) override;
40 void Reset() override;
41 void EmitInstruction(SUnit *SU) override;
42 void AdvanceCycle() override;
43 void RecedeCycle() override;
Evan Cheng62c7b5b2010-12-05 22:04:16 +000044};
45
Evan Cheng62c7b5b2010-12-05 22:04:16 +000046} // end namespace llvm
47
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000048#endif