21#define DEBUG_TYPE "loongarch-subtarget"
23#define GET_SUBTARGETINFO_TARGET_DESC
24#define GET_SUBTARGETINFO_CTOR
25#include "LoongArchGenSubtargetInfo.inc"
28 cl::desc(
"Enable the use of AA during codegen."));
30void LoongArchSubtarget::anchor() {}
39 bool Is64Bit = TT.isArch64Bit();
40 if (CPU.empty() || CPU ==
"generic")
41 CPU = Is64Bit ?
"generic-la64" :
"generic-la32";
47 initializeProperties(TuneCPU);
53 if (HasLA32 == HasLA64)
56 if (Is64Bit && HasLA32)
59 if (!Is64Bit && HasLA64)
67void LoongArchSubtarget::initializeProperties(
StringRef TuneCPU) {
88 PrefFunctionAlignment =
Align(32);
89 PrefLoopAlignment =
Align(16);
90 MaxBytesForAlignment = 16;
94 MinPrefetchStride = 1;
95 MaxPrefetchIterationsAhead = UINT_MAX;
97 if (TuneCPU ==
"la464" || TuneCPU ==
"la664") {
101 PrefetchDistance = 200;
102 MinPrefetchStride = 2048;
112 initializeSubtargetDependencies(TT, CPU, TuneCPU, FS, ABIName)),
113 InstrInfo(*this), TLInfo(TM, *this) {
114 TSInfo = std::make_unique<LoongArchSelectionDAGInfo>();
static cl::opt< bool > UseAA("loongarch-use-aa", cl::init(true), cl::desc("Enable the use of AA during codegen."))
void mirFileLoaded(MachineFunction &MF) const override
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
bool useAA() const override
LoongArchSubtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS, StringRef ABIName, const TargetMachine &TM)
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
~LoongArchSubtarget() override
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
LLVM_ABI void computeMaxCallFrameSize(MachineFunction &MF, std::vector< MachineBasicBlock::iterator > *FrameSDOps=nullptr)
Computes the maximum size of a callframe.
bool isMaxCallFrameSizeComputed() const
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
Represent a constant reference to a string, i.e.
constexpr bool empty() const
Check if the string is empty.
Primary interface to the complete machine description for the target machine.
Triple - Helper class for working with autoconf configuration names.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits, StringRef ABIName)
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)