#include "AArch64Subtarget.h"
#include "AArch64.h"
#include "AArch64InstrInfo.h"
#include "AArch64PBQPRegAlloc.h"
#include "AArch64TargetMachine.h"
#include "GISel/AArch64CallLowering.h"
#include "GISel/AArch64LegalizerInfo.h"
#include "GISel/AArch64RegisterBankInfo.h"
#include "MCTargetDesc/AArch64AddressingModes.h"
#include "llvm/CodeGen/GlobalISel/InstructionSelect.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineScheduler.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/Support/SipHash.h"
#include "llvm/TargetParser/AArch64TargetParser.h"
usingnamespacellvm;
#define DEBUG_TYPE …
#define GET_SUBTARGETINFO_CTOR
#define GET_SUBTARGETINFO_TARGET_DESC
#include "AArch64GenSubtargetInfo.inc"
static cl::opt<bool>
EnableEarlyIfConvert("aarch64-early-ifcvt", cl::desc("Enable the early if "
"converter pass"), cl::init(true), cl::Hidden);
static cl::opt<bool>
UseAddressTopByteIgnored("aarch64-use-tbi", cl::desc("Assume that top byte of "
"an address is ignored"), cl::init(false), cl::Hidden);
static cl::opt<bool> MachOUseNonLazyBind(
"aarch64-macho-enable-nonlazybind",
cl::desc("Call nonlazybind functions via direct GOT load for Mach-O"),
cl::Hidden);
static cl::opt<bool> UseAA("aarch64-use-aa", cl::init(true),
cl::desc("Enable the use of AA during codegen."));
static cl::opt<unsigned> OverrideVectorInsertExtractBaseCost(
"aarch64-insert-extract-base-cost",
cl::desc("Base cost of vector insert/extract element"), cl::Hidden);
static cl::list<std::string>
ReservedRegsForRA("reserve-regs-for-regalloc", cl::desc("Reserve physical "
"registers, so they can't be used by register allocator. "
"Should only be used for testing register allocator."),
cl::CommaSeparated, cl::Hidden);
static cl::opt<AArch64PAuth::AuthCheckMethod>
AuthenticatedLRCheckMethod("aarch64-authenticated-lr-check-method",
cl::Hidden,
cl::desc("Override the variant of check applied "
"to authenticated LR during tail call"),
cl::values(AUTH_CHECK_METHOD_CL_VALUES_LR));
static cl::opt<unsigned> AArch64MinimumJumpTableEntries(
"aarch64-min-jump-table-entries", cl::init(13), cl::Hidden,
cl::desc("Set minimum number of entries to use a jump table on AArch64"));
unsigned AArch64Subtarget::getVectorInsertExtractBaseCost() const { … }
AArch64Subtarget &AArch64Subtarget::initializeSubtargetDependencies(
StringRef FS, StringRef CPUString, StringRef TuneCPUString,
bool HasMinSize) { … }
void AArch64Subtarget::initializeProperties(bool HasMinSize) { … }
AArch64Subtarget::AArch64Subtarget(const Triple &TT, StringRef CPU,
StringRef TuneCPU, StringRef FS,
const TargetMachine &TM, bool LittleEndian,
unsigned MinSVEVectorSizeInBitsOverride,
unsigned MaxSVEVectorSizeInBitsOverride,
bool IsStreaming, bool IsStreamingCompatible,
bool HasMinSize)
: … { … }
const CallLowering *AArch64Subtarget::getCallLowering() const { … }
const InlineAsmLowering *AArch64Subtarget::getInlineAsmLowering() const { … }
InstructionSelector *AArch64Subtarget::getInstructionSelector() const { … }
const LegalizerInfo *AArch64Subtarget::getLegalizerInfo() const { … }
const RegisterBankInfo *AArch64Subtarget::getRegBankInfo() const { … }
unsigned
AArch64Subtarget::ClassifyGlobalReference(const GlobalValue *GV,
const TargetMachine &TM) const { … }
unsigned AArch64Subtarget::classifyGlobalFunctionReference(
const GlobalValue *GV, const TargetMachine &TM) const { … }
void AArch64Subtarget::overrideSchedPolicy(MachineSchedPolicy &Policy,
unsigned NumRegionInstrs) const { … }
void AArch64Subtarget::adjustSchedDependency(
SUnit *Def, int DefOpIdx, SUnit *Use, int UseOpIdx, SDep &Dep,
const TargetSchedModel *SchedModel) const { … }
bool AArch64Subtarget::enableEarlyIfConversion() const { … }
bool AArch64Subtarget::supportsAddressTopByteIgnored() const { … }
std::unique_ptr<PBQPRAConstraint>
AArch64Subtarget::getCustomPBQPConstraints() const { … }
void AArch64Subtarget::mirFileLoaded(MachineFunction &MF) const { … }
bool AArch64Subtarget::useAA() const { … }
AArch64PAuth::AuthCheckMethod AArch64Subtarget::getAuthenticatedLRCheckMethod(
const MachineFunction &MF) const { … }
std::optional<uint16_t>
AArch64Subtarget::getPtrAuthBlockAddressDiscriminatorIfEnabled(
const Function &ParentFn) const { … }
bool AArch64Subtarget::enableMachinePipeliner() const { … }