| Evan Cheng | 62c7b5b | 2010-12-05 22:04:16 +0000 | [diff] [blame] | 1 | //===-- ARMHazardRecognizer.h - ARM Hazard Recognizers ----------*- C++ -*-===// |
| 2 | // |
| Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 |
| Evan Cheng | 62c7b5b | 2010-12-05 22:04:16 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file defines hazard recognizers for scheduling ARM functions. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 13 | #ifndef LLVM_LIB_TARGET_ARM_ARMHAZARDRECOGNIZER_H |
| 14 | #define LLVM_LIB_TARGET_ARM_ARMHAZARDRECOGNIZER_H |
| Evan Cheng | 62c7b5b | 2010-12-05 22:04:16 +0000 | [diff] [blame] | 15 | |
| Andrew Trick | 00067fb | 2010-12-08 20:04:29 +0000 | [diff] [blame] | 16 | #include "llvm/CodeGen/ScoreboardHazardRecognizer.h" |
| Evan Cheng | 62c7b5b | 2010-12-05 22:04:16 +0000 | [diff] [blame] | 17 | |
| 18 | namespace llvm { |
| 19 | |
| 20 | class ARMBaseInstrInfo; |
| 21 | class ARMBaseRegisterInfo; |
| 22 | class ARMSubtarget; |
| 23 | class MachineInstr; |
| 24 | |
| Andrew Trick | 312b97c | 2011-11-29 19:33:49 +0000 | [diff] [blame] | 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. |
| Andrew Trick | 00067fb | 2010-12-08 20:04:29 +0000 | [diff] [blame] | 29 | class ARMHazardRecognizer : public ScoreboardHazardRecognizer { |
| Simon Pilgrim | b5f94ad | 2019-11-14 13:50:38 +0000 | [diff] [blame] | 30 | MachineInstr *LastMI = nullptr; |
| 31 | unsigned FpMLxStalls = 0; |
| Evan Cheng | 62c7b5b | 2010-12-05 22:04:16 +0000 | [diff] [blame] | 32 | |
| 33 | public: |
| 34 | ARMHazardRecognizer(const InstrItineraryData *ItinData, |
| Bill Wendling | f95178e | 2013-06-07 05:54:19 +0000 | [diff] [blame] | 35 | const ScheduleDAG *DAG) |
| Simon Pilgrim | b5f94ad | 2019-11-14 13:50:38 +0000 | [diff] [blame] | 36 | : ScoreboardHazardRecognizer(ItinData, DAG, "post-RA-sched") {} |
| Evan Cheng | 62c7b5b | 2010-12-05 22:04:16 +0000 | [diff] [blame] | 37 | |
| Craig Topper | 6bc27bf | 2014-03-10 02:09:33 +0000 | [diff] [blame] | 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; |
| Evan Cheng | 62c7b5b | 2010-12-05 22:04:16 +0000 | [diff] [blame] | 43 | }; |
| 44 | |
| Evan Cheng | 62c7b5b | 2010-12-05 22:04:16 +0000 | [diff] [blame] | 45 | } // end namespace llvm |
| 46 | |
| Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 47 | #endif |