X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FAArch64%2FAArch64Subtarget.h;h=6bb069423060bfed2aecae1d0f0ab4dc618b06b0;hb=00552e3875ee5f382db6c98286a241a7d0efe1b8;hp=590ea0580ea743c3e48423989cde3ab494556b80;hpb=29f94c72014eaa5d0d3b920686e689e79759cacb;p=oota-llvm.git diff --git a/lib/Target/AArch64/AArch64Subtarget.h b/lib/Target/AArch64/AArch64Subtarget.h index 590ea0580ea..6bb06942306 100644 --- a/lib/Target/AArch64/AArch64Subtarget.h +++ b/lib/Target/AArch64/AArch64Subtarget.h @@ -11,11 +11,16 @@ // //===----------------------------------------------------------------------===// -#ifndef AArch64SUBTARGET_H -#define AArch64SUBTARGET_H +#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64SUBTARGET_H +#define LLVM_LIB_TARGET_AARCH64_AARCH64SUBTARGET_H -#include "llvm/Target/TargetSubtargetInfo.h" +#include "AArch64FrameLowering.h" +#include "AArch64ISelLowering.h" +#include "AArch64InstrInfo.h" #include "AArch64RegisterInfo.h" +#include "AArch64SelectionDAGInfo.h" +#include "llvm/IR/DataLayout.h" +#include "llvm/Target/TargetSubtargetInfo.h" #include #define GET_SUBTARGETINFO_HEADER @@ -24,6 +29,7 @@ namespace llvm { class GlobalValue; class StringRef; +class Triple; class AArch64Subtarget : public AArch64GenSubtargetInfo { protected: @@ -32,6 +38,8 @@ protected: /// ARMProcFamily - ARM processor family: Cortex-A53, Cortex-A57, and others. ARMProcFamilyEnum ARMProcFamily; + bool HasV8_1aOps; + bool HasFPARMv8; bool HasNEON; bool HasCrypto; @@ -43,22 +51,51 @@ protected: // HasZeroCycleZeroing - Has zero-cycle zeroing instructions. bool HasZeroCycleZeroing; + bool IsLittle; + /// CPUString - String name of used CPU. std::string CPUString; /// TargetTriple - What processor and OS we're targeting. Triple TargetTriple; - /// IsLittleEndian - Is the target little endian? - bool IsLittleEndian; + AArch64FrameLowering FrameLowering; + AArch64InstrInfo InstrInfo; + AArch64SelectionDAGInfo TSInfo; + AArch64TargetLowering TLInfo; +private: + /// initializeSubtargetDependencies - Initializes using CPUString and the + /// passed in feature string so that we can use initializer lists for + /// subtarget initialization. + AArch64Subtarget &initializeSubtargetDependencies(StringRef FS); public: /// This constructor initializes the data members to match that /// of the specified triple. - AArch64Subtarget(const std::string &TT, const std::string &CPU, - const std::string &FS, bool LittleEndian); - + AArch64Subtarget(const Triple &TT, const std::string &CPU, + const std::string &FS, const TargetMachine &TM, + bool LittleEndian); + + const AArch64SelectionDAGInfo *getSelectionDAGInfo() const override { + return &TSInfo; + } + const AArch64FrameLowering *getFrameLowering() const override { + return &FrameLowering; + } + const AArch64TargetLowering *getTargetLowering() const override { + return &TLInfo; + } + const AArch64InstrInfo *getInstrInfo() const override { return &InstrInfo; } + const AArch64RegisterInfo *getRegisterInfo() const override { + return &getInstrInfo()->getRegisterInfo(); + } + const Triple &getTargetTriple() const { return TargetTriple; } bool enableMachineScheduler() const override { return true; } + bool enablePostRAScheduler() const override { + return isCortexA53() || isCortexA57(); + } + + bool hasV8_1aOps() const { return HasV8_1aOps; } bool hasZeroCycleRegMove() const { return HasZeroCycleRegMove; } @@ -69,15 +106,22 @@ public: bool hasCrypto() const { return HasCrypto; } bool hasCRC() const { return HasCRC; } - bool isLittleEndian() const { return IsLittleEndian; } + bool isLittleEndian() const { return IsLittle; } bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); } + bool isTargetIOS() const { return TargetTriple.isiOS(); } + bool isTargetLinux() const { return TargetTriple.isOSLinux(); } + bool isTargetWindows() const { return TargetTriple.isOSWindows(); } + bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); } bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); } - bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); } bool isCyclone() const { return CPUString == "cyclone"; } + bool isCortexA57() const { return CPUString == "cortex-a57"; } + bool isCortexA53() const { return CPUString == "cortex-a53"; } + + bool useAA() const override { return isCortexA53(); } /// getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size /// that still makes it profitable to inline the call. @@ -104,7 +148,9 @@ public: unsigned NumRegionInstrs) const override; bool enableEarlyIfConversion() const override; + + std::unique_ptr getCustomPBQPConstraints() const override; }; } // End llvm namespace -#endif // AArch64SUBTARGET_H +#endif