34#define DEBUG_TYPE "ppc-subtarget"
36#define GET_SUBTARGETINFO_TARGET_DESC
37#define GET_SUBTARGETINFO_CTOR
38#include "PPCGenSubtargetInfo.inc"
43 initializeEnvironment();
44 initSubtargetFeatures(CPU, TuneCPU, FS);
55 TSInfo = std::make_unique<PPCSelectionDAGInfo>();
71void PPCSubtarget::initializeEnvironment() {
80 std::string CPUName = std::string(CPU);
81 if (CPUName.empty() || CPU ==
"generic") {
89 if (TuneCPU.
empty()) TuneCPU = CPUName;
99 if (IsPPC64 && has64BitSupport())
102 if (getTargetTriple().isPPC32SecurePlt())
105 if (HasSPE && IsPPC64)
107 if (HasSPE && (HasAltivec || HasVSX || HasFPU))
109 "SPE and traditional floating point cannot both be enabled.\n",
false);
120 if (HasAIXSmallLocalExecTLS || HasAIXSmallLocalDynamicTLS) {
121 if (!getTargetTriple().isOSAIX() || !IsPPC64)
123 "only supported on AIX in "
131 if (!
TM.getDataSections())
133 "only be specified with "
138 if (HasAIXShLibTLSModelOpt && (!getTargetTriple().isOSAIX() || !IsPPC64))
140 "is only supported on AIX in 64-bit mode.\n",
143 if (UsePointerGlueHelper && !getTargetTriple().isOSAIX())
151 return getSchedModel().hasInstrSchedModel();
160 return TargetSubtargetInfo::ANTIDEP_ALL;
164 CriticalPathRCs.clear();
165 CriticalPathRCs.push_back(isPPC64() ?
166 &PPC::G8RCRegClass : &PPC::GPRCRegClass);
192 return !GVar->hasAttribute(
"toc-data");
201 if (
TM.shouldAssumeDSOLocal(GV))
218 assert(GV &&
"Unexpected NULL GlobalValue");
235 std::optional<CodeModel::Model> MaybeCodeModel = GlobalVar->getCodeModel();
236 if (MaybeCodeModel) {
239 "invalid code model for AIX");
249 return isPPC64() && hasPCRelativeMemops() &&
isELFv2ABI() &&
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file describes how to lower LLVM calls to machine code calls.
This file declares the targeting of the Machinelegalizer class for PowerPC.
This file declares the targeting of the RegisterBankInfo class for PowerPC.
LLVM_ABI const GlobalObject * getAliaseeObject() const
This class provides the information for the PowerPC target legalizer for GlobalISel.
std::unique_ptr< InstructionSelector > InstSelector
bool enableMachinePipeliner() const override
Pipeliner customization.
bool useDFAforSMS() const override
Machine Pipeliner customization.
std::unique_ptr< LegalizerInfo > Legalizer
PPCSubtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS, StringRef ABIName, const PPCTargetMachine &TM)
This constructor initializes the data members to match that of the specified triple.
PPCFrameLowering FrameLowering
const CallLowering * getCallLowering() const override
const LegalizerInfo * getLegalizerInfo() const override
std::unique_ptr< RegisterBankInfo > RegBankInfo
InstrItineraryData InstrItins
Selected instruction itineraries (one entry per itinerary class.)
Align StackAlignment
stackAlignment - The minimum alignment known to hold of the stack frame on entry to the function and ...
void getCriticalPathRCs(RegClassVector &CriticalPathRCs) const override
bool isUsingPCRelativeCalls() const
bool enableSubRegLiveness() const override
const PPCTargetLowering * getTargetLowering() const override
InstructionSelector * getInstructionSelector() const override
unsigned CPUDirective
Which cpu directive was used.
AntiDepBreakMode getAntiDepBreakMode() const override
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
bool useAA() const override
PPCABI TargetABI
The selected ABI variant.
PPCSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef TuneCPU, StringRef FS)
initializeSubtargetDependencies - Initializes using a CPU, a TuneCPU, and feature string so that we c...
CodeModel::Model getCodeModel(const TargetMachine &TM, const GlobalValue *GV) const
Calculates the effective code model for argument GV.
Align getPlatformStackAlignment() const
const PPCTargetMachine & getTargetMachine() const
const PPCTargetMachine & TM
std::unique_ptr< const SelectionDAGTargetInfo > TSInfo
bool enableMachineScheduler() const override
Scheduling customization.
void overrideSchedPolicy(MachineSchedPolicy &Policy, const SchedRegion &Region) const override
const RegisterBankInfo * getRegBankInfo() const override
const PPCRegisterInfo * getRegisterInfo() const override
bool isGVIndirectSymbol(const GlobalValue *GV) const
True if the GV will be accessed via an indirect symbol.
std::unique_ptr< CallLowering > CallLoweringInfo
GlobalISel related APIs.
bool enablePostRAScheduler() const override
This overrides the PostRAScheduler bit in the SchedModel for each CPU.
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
Common code between 32-bit and 64-bit PowerPC targets.
Holds all the information related to register banks.
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.
CodeModel::Model getCodeModel() const
Returns the code model.
Triple - Helper class for working with autoconf configuration names.
LLVM_ABI StringRef getNormalizedPPCTargetCPU(const Triple &T, StringRef CPUName="")
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
InstructionSelector * createPPCInstructionSelector(const PPCTargetMachine &TM, const PPCSubtarget &Subtarget, const PPCRegisterBankInfo &RBI)
This struct is a compact representation of a valid (non-zero power of two) alignment.
Define a generic scheduling policy for targets that don't provide their own MachineSchedStrategy.
A region of an MBB for scheduling.