aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/Hexagon/HexagonSubtarget.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonSubtarget.h')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonSubtarget.h55
1 files changed, 50 insertions, 5 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonSubtarget.h b/llvm/lib/Target/Hexagon/HexagonSubtarget.h
index 31157a0065d9..de4f245519e4 100644
--- a/llvm/lib/Target/Hexagon/HexagonSubtarget.h
+++ b/llvm/lib/Target/Hexagon/HexagonSubtarget.h
@@ -13,7 +13,7 @@
#ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONSUBTARGET_H
#define LLVM_LIB_TARGET_HEXAGON_HEXAGONSUBTARGET_H
-#include "HexagonDepArch.h"
+#include "HexagonArch.h"
#include "HexagonFrameLowering.h"
#include "HexagonISelLowering.h"
#include "HexagonInstrInfo.h"
@@ -45,14 +45,18 @@ class HexagonSubtarget : public HexagonGenSubtargetInfo {
bool UseHVX64BOps = false;
bool UseHVX128BOps = false;
+ bool UseAudioOps = false;
+ bool UseCompound = false;
bool UseLongCalls = false;
bool UseMemops = false;
bool UsePackets = false;
bool UseNewValueJumps = false;
bool UseNewValueStores = false;
bool UseSmallData = false;
+ bool UseUnsafeMath = false;
bool UseZRegOps = false;
+ bool HasPreV65 = false;
bool HasMemNoShuf = false;
bool EnableDuplex = false;
bool ReservedR19 = false;
@@ -83,7 +87,14 @@ public:
};
private:
+ enum HexagonProcFamilyEnum { Others, TinyCore };
+
std::string CPUString;
+ Triple TargetTriple;
+
+ // The following objects can use the TargetTriple, so they must be
+ // declared after it.
+ HexagonProcFamilyEnum HexagonProcFamily = Others;
HexagonInstrInfo InstrInfo;
HexagonRegisterInfo RegInfo;
HexagonTargetLowering TLInfo;
@@ -95,6 +106,11 @@ public:
HexagonSubtarget(const Triple &TT, StringRef CPU, StringRef FS,
const TargetMachine &TM);
+ const Triple &getTargetTriple() const { return TargetTriple; }
+ bool isEnvironmentMusl() const {
+ return TargetTriple.getEnvironment() == Triple::Musl;
+ }
+
/// getInstrItins - Return the instruction itineraries based on subtarget
/// selection.
const InstrItineraryData *getInstrItineraryData() const override {
@@ -157,18 +173,45 @@ public:
bool hasV66OpsOnly() const {
return getHexagonArchVersion() == Hexagon::ArchEnum::V66;
}
+ bool hasV67Ops() const {
+ return getHexagonArchVersion() >= Hexagon::ArchEnum::V67;
+ }
+ bool hasV67OpsOnly() const {
+ return getHexagonArchVersion() == Hexagon::ArchEnum::V67;
+ }
+ bool useAudioOps() const { return UseAudioOps; }
+ bool useCompound() const { return UseCompound; }
bool useLongCalls() const { return UseLongCalls; }
bool useMemops() const { return UseMemops; }
bool usePackets() const { return UsePackets; }
bool useNewValueJumps() const { return UseNewValueJumps; }
bool useNewValueStores() const { return UseNewValueStores; }
bool useSmallData() const { return UseSmallData; }
+ bool useUnsafeMath() const { return UseUnsafeMath; }
bool useZRegOps() const { return UseZRegOps; }
+ bool isTinyCore() const { return HexagonProcFamily == TinyCore; }
+ bool isTinyCoreWithDuplex() const { return isTinyCore() && EnableDuplex; }
+
bool useHVXOps() const {
return HexagonHVXVersion > Hexagon::ArchEnum::NoArch;
}
+ bool useHVXV60Ops() const {
+ return HexagonHVXVersion >= Hexagon::ArchEnum::V60;
+ }
+ bool useHVXV62Ops() const {
+ return HexagonHVXVersion >= Hexagon::ArchEnum::V62;
+ }
+ bool useHVXV65Ops() const {
+ return HexagonHVXVersion >= Hexagon::ArchEnum::V65;
+ }
+ bool useHVXV66Ops() const {
+ return HexagonHVXVersion >= Hexagon::ArchEnum::V66;
+ }
+ bool useHVXV67Ops() const {
+ return HexagonHVXVersion >= Hexagon::ArchEnum::V67;
+ }
bool useHVX128BOps() const { return useHVXOps() && UseHVX128BOps; }
bool useHVX64BOps() const { return useHVXOps() && UseHVX64BOps; }
@@ -186,7 +229,11 @@ public:
// compiler time and will be removed eventually anyway.
bool enableMachineSchedDefaultSched() const override { return false; }
+ // For use with PostRAScheduling: get the anti-dependence breaking that should
+ // be performed before post-RA scheduling.
AntiDepBreakMode getAntiDepBreakMode() const override { return ANTIDEP_ALL; }
+ /// True if the subtarget should run a scheduler after register
+ /// allocation.
bool enablePostRAScheduler() const override { return true; }
bool enableSubRegLiveness() const override;
@@ -211,7 +258,8 @@ public:
/// Perform target specific adjustments to the latency of a schedule
/// dependency.
- void adjustSchedDependency(SUnit *def, SUnit *use, SDep& dep) const override;
+ void adjustSchedDependency(SUnit *Def, int DefOpIdx, SUnit *Use, int UseOpIdx,
+ SDep &Dep) const override;
unsigned getVectorLength() const {
assert(useHVXOps());
@@ -239,9 +287,6 @@ public:
ArrayRef<MVT> ElemTypes = getHVXElementTypes();
if (IncludeBool && ElemTy == MVT::i1) {
- // Special case for the v512i1, etc.
- if (8*HwLen == NumElems)
- return true;
// Boolean HVX vector types are formed from regular HVX vector types
// by replacing the element type with i1.
for (MVT T : ElemTypes)