diff options
Diffstat (limited to 'contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.h')
-rw-r--r-- | contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.h | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.h b/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.h index f2b9cda..753dca00 100644 --- a/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.h +++ b/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.h @@ -1,4 +1,4 @@ -//===-- HexagonSubtarget.h - Define Subtarget for the Hexagon ---*- C++ -*-===// +//===- HexagonSubtarget.h - Define Subtarget for the Hexagon ----*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -15,12 +15,17 @@ #define LLVM_LIB_TARGET_HEXAGON_HEXAGONSUBTARGET_H #include "HexagonFrameLowering.h" -#include "HexagonISelLowering.h" #include "HexagonInstrInfo.h" +#include "HexagonISelLowering.h" #include "HexagonSelectionDAGInfo.h" -#include "llvm/Target/TargetMachine.h" +#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/CodeGen/ScheduleDAGMutation.h" +#include "llvm/MC/MCInstrItineraries.h" #include "llvm/Target/TargetSubtargetInfo.h" +#include <memory> #include <string> +#include <vector> #define GET_SUBTARGETINFO_HEADER #include "HexagonGenSubtargetInfo.inc" @@ -30,6 +35,12 @@ namespace llvm { +class MachineInstr; +class SDep; +class SUnit; +class TargetMachine; +class Triple; + class HexagonSubtarget : public HexagonGenSubtargetInfo { virtual void anchor(); @@ -38,9 +49,7 @@ class HexagonSubtarget : public HexagonGenSubtargetInfo { bool ModeIEEERndNear; public: - enum HexagonArchEnum { - V4, V5, V55, V60 - }; +#include "HexagonDepArch.h" HexagonArchEnum HexagonArchVersion; /// True if the target should use Back-Skip-Back scheduling. This is the @@ -59,6 +68,7 @@ private: HexagonSelectionDAGInfo TSInfo; HexagonFrameLowering FrameLowering; InstrItineraryData InstrItins; + void initializeEnvironment(); public: @@ -98,14 +108,19 @@ public: bool hasV55TOpsOnly() const { return getHexagonArchVersion() == V55; } bool hasV60TOps() const { return getHexagonArchVersion() >= V60; } bool hasV60TOpsOnly() const { return getHexagonArchVersion() == V60; } + bool hasV62TOps() const { return getHexagonArchVersion() >= V62; } + bool hasV62TOpsOnly() const { return getHexagonArchVersion() == V62; } + bool modeIEEERndNear() const { return ModeIEEERndNear; } bool useHVXOps() const { return UseHVXOps; } bool useHVXDblOps() const { return UseHVXOps && UseHVXDblOps; } bool useHVXSglOps() const { return UseHVXOps && !UseHVXDblOps; } bool useLongCalls() const { return UseLongCalls; } + bool usePredicatedCalls() const; bool useBSBScheduling() const { return UseBSBScheduling; } bool enableMachineScheduler() const override; + // Always use the TargetLowering default scheduler. // FIXME: This will use the vliw scheduler which is probably just hurting // compiler time and will be removed eventually anyway. @@ -122,6 +137,7 @@ public: unsigned getSmallDataThreshold() const { return Hexagon_SMALL_DATA_THRESHOLD; } + const HexagonArchEnum &getHexagonArchVersion() const { return HexagonArchVersion; } @@ -145,13 +161,12 @@ private: // Helper function responsible for increasing the latency only. void updateLatency(MachineInstr &SrcInst, MachineInstr &DstInst, SDep &Dep) const; - void changeLatency(SUnit *Src, SmallVector<SDep, 4> &Deps, SUnit *Dst, - unsigned Lat) const; - bool isBestZeroLatency(SUnit *Src, SUnit *Dst, const HexagonInstrInfo *TII) - const; - void changePhiLatency(MachineInstr &SrcInst, SUnit *Dst, SDep &Dep) const; + void restoreLatency(SUnit *Src, SUnit *Dst) const; + void changeLatency(SUnit *Src, SUnit *Dst, unsigned Lat) const; + bool isBestZeroLatency(SUnit *Src, SUnit *Dst, const HexagonInstrInfo *TII, + SmallSet<SUnit*, 4> &ExclSrc, SmallSet<SUnit*, 4> &ExclDst) const; }; } // end namespace llvm -#endif +#endif // LLVM_LIB_TARGET_HEXAGON_HEXAGONSUBTARGET_H |