2014-05-24 12:50:23 +00:00
|
|
|
//===--- AArch64Subtarget.h - Define Subtarget for the AArch64 -*- C++ -*--===//
|
2014-03-29 10:18:08 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2014-05-24 12:50:23 +00:00
|
|
|
// This file declares the AArch64 specific subclass of TargetSubtarget.
|
2014-03-29 10:18:08 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-13 16:26:38 +00:00
|
|
|
#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64SUBTARGET_H
|
|
|
|
#define LLVM_LIB_TARGET_AARCH64_AARCH64SUBTARGET_H
|
2014-03-29 10:18:08 +00:00
|
|
|
|
2014-06-10 17:44:12 +00:00
|
|
|
#include "AArch64FrameLowering.h"
|
2014-06-10 23:26:45 +00:00
|
|
|
#include "AArch64ISelLowering.h"
|
2014-07-25 11:42:14 +00:00
|
|
|
#include "AArch64InstrInfo.h"
|
2014-05-24 12:50:23 +00:00
|
|
|
#include "AArch64RegisterInfo.h"
|
2014-06-10 18:21:53 +00:00
|
|
|
#include "AArch64SelectionDAGInfo.h"
|
2014-06-10 18:06:23 +00:00
|
|
|
#include "llvm/IR/DataLayout.h"
|
2014-06-10 17:44:12 +00:00
|
|
|
#include "llvm/Target/TargetSubtargetInfo.h"
|
2014-03-29 10:18:08 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#define GET_SUBTARGETINFO_HEADER
|
2014-05-24 12:50:23 +00:00
|
|
|
#include "AArch64GenSubtargetInfo.inc"
|
2014-03-29 10:18:08 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class GlobalValue;
|
|
|
|
class StringRef;
|
2015-06-10 12:11:26 +00:00
|
|
|
class Triple;
|
2014-03-29 10:18:08 +00:00
|
|
|
|
2014-05-24 12:50:23 +00:00
|
|
|
class AArch64Subtarget : public AArch64GenSubtargetInfo {
|
2014-03-29 10:18:08 +00:00
|
|
|
protected:
|
2014-04-14 17:38:00 +00:00
|
|
|
enum ARMProcFamilyEnum {Others, CortexA53, CortexA57, Cyclone};
|
|
|
|
|
|
|
|
/// ARMProcFamily - ARM processor family: Cortex-A53, Cortex-A57, and others.
|
|
|
|
ARMProcFamilyEnum ARMProcFamily;
|
|
|
|
|
2015-04-01 14:49:29 +00:00
|
|
|
bool HasV8_1aOps;
|
|
|
|
|
2014-04-14 17:38:00 +00:00
|
|
|
bool HasFPARMv8;
|
|
|
|
bool HasNEON;
|
|
|
|
bool HasCrypto;
|
2014-04-25 09:25:42 +00:00
|
|
|
bool HasCRC;
|
2014-04-14 17:38:00 +00:00
|
|
|
|
2014-03-29 10:18:08 +00:00
|
|
|
// HasZeroCycleRegMove - Has zero-cycle register mov instructions.
|
|
|
|
bool HasZeroCycleRegMove;
|
|
|
|
|
|
|
|
// HasZeroCycleZeroing - Has zero-cycle zeroing instructions.
|
|
|
|
bool HasZeroCycleZeroing;
|
|
|
|
|
2015-01-26 19:03:15 +00:00
|
|
|
bool IsLittle;
|
|
|
|
|
2014-03-29 10:18:08 +00:00
|
|
|
/// CPUString - String name of used CPU.
|
|
|
|
std::string CPUString;
|
|
|
|
|
|
|
|
/// TargetTriple - What processor and OS we're targeting.
|
|
|
|
Triple TargetTriple;
|
|
|
|
|
2014-06-10 17:44:12 +00:00
|
|
|
AArch64FrameLowering FrameLowering;
|
2014-06-10 22:57:25 +00:00
|
|
|
AArch64InstrInfo InstrInfo;
|
2014-06-10 18:21:53 +00:00
|
|
|
AArch64SelectionDAGInfo TSInfo;
|
2014-06-11 00:46:34 +00:00
|
|
|
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);
|
2014-06-10 17:44:12 +00:00
|
|
|
|
2014-03-29 10:18:08 +00:00
|
|
|
public:
|
|
|
|
/// This constructor initializes the data members to match that
|
|
|
|
/// of the specified triple.
|
2015-06-10 12:11:26 +00:00
|
|
|
AArch64Subtarget(const Triple &TT, const std::string &CPU,
|
2015-03-18 20:37:30 +00:00
|
|
|
const std::string &FS, const TargetMachine &TM,
|
2014-10-03 00:42:41 +00:00
|
|
|
bool LittleEndian);
|
2014-03-29 10:18:08 +00:00
|
|
|
|
2014-08-04 21:25:23 +00:00
|
|
|
const AArch64SelectionDAGInfo *getSelectionDAGInfo() const override {
|
|
|
|
return &TSInfo;
|
|
|
|
}
|
|
|
|
const AArch64FrameLowering *getFrameLowering() const override {
|
2014-06-10 17:44:12 +00:00
|
|
|
return &FrameLowering;
|
|
|
|
}
|
2014-08-04 21:25:23 +00:00
|
|
|
const AArch64TargetLowering *getTargetLowering() const override {
|
2014-06-11 00:46:34 +00:00
|
|
|
return &TLInfo;
|
2014-06-10 23:26:45 +00:00
|
|
|
}
|
2014-08-04 21:25:23 +00:00
|
|
|
const AArch64InstrInfo *getInstrInfo() const override { return &InstrInfo; }
|
2015-03-18 20:37:30 +00:00
|
|
|
const AArch64RegisterInfo *getRegisterInfo() const override {
|
|
|
|
return &getInstrInfo()->getRegisterInfo();
|
|
|
|
}
|
2015-03-12 02:04:46 +00:00
|
|
|
const Triple &getTargetTriple() const { return TargetTriple; }
|
2014-03-30 07:25:18 +00:00
|
|
|
bool enableMachineScheduler() const override { return true; }
|
2015-06-13 03:42:16 +00:00
|
|
|
bool enablePostRAScheduler() const override {
|
2014-09-12 17:40:39 +00:00
|
|
|
return isCortexA53() || isCortexA57();
|
|
|
|
}
|
2014-03-29 10:18:08 +00:00
|
|
|
|
2015-04-01 14:49:29 +00:00
|
|
|
bool hasV8_1aOps() const { return HasV8_1aOps; }
|
|
|
|
|
2014-03-29 10:18:08 +00:00
|
|
|
bool hasZeroCycleRegMove() const { return HasZeroCycleRegMove; }
|
|
|
|
|
|
|
|
bool hasZeroCycleZeroing() const { return HasZeroCycleZeroing; }
|
|
|
|
|
2014-04-14 17:38:00 +00:00
|
|
|
bool hasFPARMv8() const { return HasFPARMv8; }
|
|
|
|
bool hasNEON() const { return HasNEON; }
|
|
|
|
bool hasCrypto() const { return HasCrypto; }
|
2014-04-25 09:25:42 +00:00
|
|
|
bool hasCRC() const { return HasCRC; }
|
2014-04-14 17:38:00 +00:00
|
|
|
|
2015-01-26 19:03:15 +00:00
|
|
|
bool isLittleEndian() const { return IsLittle; }
|
2014-04-23 10:26:40 +00:00
|
|
|
|
2014-03-29 10:18:08 +00:00
|
|
|
bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
|
2014-08-06 16:56:58 +00:00
|
|
|
bool isTargetIOS() const { return TargetTriple.isiOS(); }
|
|
|
|
bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
|
|
|
|
bool isTargetWindows() const { return TargetTriple.isOSWindows(); }
|
2014-03-29 10:18:08 +00:00
|
|
|
|
2014-08-06 16:56:58 +00:00
|
|
|
bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); }
|
2014-03-29 10:18:08 +00:00
|
|
|
bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
|
|
|
|
bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }
|
|
|
|
|
|
|
|
bool isCyclone() const { return CPUString == "cyclone"; }
|
2014-07-29 02:09:26 +00:00
|
|
|
bool isCortexA57() const { return CPUString == "cortex-a57"; }
|
|
|
|
bool isCortexA53() const { return CPUString == "cortex-a53"; }
|
2014-03-29 10:18:08 +00:00
|
|
|
|
2014-11-19 06:48:56 +00:00
|
|
|
bool useAA() const override { return isCortexA53(); }
|
2014-09-08 14:31:49 +00:00
|
|
|
|
2014-03-29 10:18:08 +00:00
|
|
|
/// getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size
|
|
|
|
/// that still makes it profitable to inline the call.
|
|
|
|
unsigned getMaxInlineSizeThreshold() const { return 64; }
|
|
|
|
|
|
|
|
/// ParseSubtargetFeatures - Parses features string setting specified
|
|
|
|
/// subtarget options. Definition of function is auto generated by tblgen.
|
|
|
|
void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
|
|
|
|
|
|
|
|
/// ClassifyGlobalReference - Find the target operand flags that describe
|
|
|
|
/// how a global value should be referenced for the current subtarget.
|
|
|
|
unsigned char ClassifyGlobalReference(const GlobalValue *GV,
|
|
|
|
const TargetMachine &TM) const;
|
|
|
|
|
|
|
|
/// This function returns the name of a function which has an interface
|
|
|
|
/// like the non-standard bzero function, if such a function exists on
|
|
|
|
/// the current subtarget and it is considered prefereable over
|
|
|
|
/// memset with zero passed as the second argument. Otherwise it
|
|
|
|
/// returns null.
|
|
|
|
const char *getBZeroEntry() const;
|
|
|
|
|
|
|
|
void overrideSchedPolicy(MachineSchedPolicy &Policy, MachineInstr *begin,
|
2014-04-29 07:58:25 +00:00
|
|
|
MachineInstr *end,
|
|
|
|
unsigned NumRegionInstrs) const override;
|
2014-05-21 23:40:26 +00:00
|
|
|
|
|
|
|
bool enableEarlyIfConversion() const override;
|
2014-10-09 18:20:51 +00:00
|
|
|
|
|
|
|
std::unique_ptr<PBQPRAConstraint> getCustomPBQPConstraints() const override;
|
2014-03-29 10:18:08 +00:00
|
|
|
};
|
|
|
|
} // End llvm namespace
|
|
|
|
|
2014-08-13 16:26:38 +00:00
|
|
|
#endif
|