blob: ca02cc739e112b10012cb747f90776b5b9dad5e4 [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 {
Simon Pilgrimb5f94ad2019-11-14 13:50:38 +000030 MachineInstr *LastMI = nullptr;
31 unsigned FpMLxStalls = 0;
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)
Simon Pilgrimb5f94ad2019-11-14 13:50:38 +000036 : ScoreboardHazardRecognizer(ItinData, DAG, "post-RA-sched") {}
Evan Cheng62c7b5b2010-12-05 22:04:16 +000037
Craig Topper6bc27bf2014-03-10 02:09:33 +000038 HazardType getHazardType(SUnit *SU, int Stalls) override;
39 void Reset() override;
40 void EmitInstruction(SUnit *SU) override;
41 void AdvanceCycle() override;
42 void RecedeCycle() override;
Evan Cheng62c7b5b2010-12-05 22:04:16 +000043};
44
Evan Cheng62c7b5b2010-12-05 22:04:16 +000045} // end namespace llvm
46
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000047#endif