1 //===-- ARMHazardRecognizer.h - ARM Hazard Recognizers ----------*- C++ -*-===//
3 // 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
7 //===----------------------------------------------------------------------===//
9 // This file defines hazard recognizers for scheduling ARM functions.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_ARM_ARMHAZARDRECOGNIZER_H
14 #define LLVM_LIB_TARGET_ARM_ARMHAZARDRECOGNIZER_H
16 #include "llvm/CodeGen/ScoreboardHazardRecognizer.h"
20 class ARMBaseInstrInfo;
21 class ARMBaseRegisterInfo;
25 /// 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.
29 class ARMHazardRecognizer : public ScoreboardHazardRecognizer {
30 MachineInstr *LastMI = nullptr;
31 unsigned FpMLxStalls = 0;
34 ARMHazardRecognizer(const InstrItineraryData *ItinData,
35 const ScheduleDAG *DAG)
36 : ScoreboardHazardRecognizer(ItinData, DAG, "post-RA-sched") {}
38 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;
45 } // end namespace llvm