45 cl::desc(
"Disable CTR loops for PPC"));
49 cl::desc(
"Disable PPC loop preinc prep"));
57 cl::desc(
"Disable VSX Swap Removal for PPC"));
61 cl::desc(
"Disable QPX load splat simplification"));
65 cl::desc(
"Disable machine peepholes for PPC"));
69 cl::desc(
"Enable optimizations on complex GEPs"),
74 cl::desc(
"disable software prefetching on PPC"),
79 cl::desc(
"Add extra TOC register dependencies"),
84 cl::desc(
"Enable the machine combiner pass"),
135 std::string FullFS = FS;
140 FullFS =
"+64bit," + FullFS;
147 FullFS =
"+crbits," + FullFS;
154 FullFS =
"+invariant-function-descriptors," + FullFS;
156 FullFS =
"+invariant-function-descriptors";
166 return llvm::make_unique<TargetLoweringObjectFileMachO>();
168 return llvm::make_unique<PPC64LinuxTargetObjectFile>();
179 "Unknown target-abi option!");
252 FS += FS.
empty() ?
"-hard-float" :
",-hard-float";
254 auto &
I = SubtargetMap[CPU + FS];
260 I = llvm::make_unique<PPCSubtarget>(
286 return getTM<PPCTargetMachine>();
289 void addIRPasses()
override;
290 bool addPreISel()
override;
291 bool addILPOpts()
override;
292 bool addInstSelector()
override;
293 void addMachineSSAOptimization()
override;
294 void addPreRegAlloc()
override;
295 void addPreSched2()
override;
296 void addPreEmitPass()
override;
302 return new PPCPassConfig(*
this, PM);
305 void PPCPassConfig::addIRPasses() {
312 bool UsePrefetching =
TM->getTargetTriple().getVendor() ==
Triple::BGQ &&
335 bool PPCPassConfig::addPreISel() {
345 bool PPCPassConfig::addILPOpts() {
354 bool PPCPassConfig::addInstSelector() {
367 void PPCPassConfig::addMachineSSAOptimization() {
382 void PPCPassConfig::addPreRegAlloc() {
390 if (getPPCTargetMachine().isPositionIndependent()) {
402 void PPCPassConfig::addPreSched2() {
414 void PPCPassConfig::addPreEmitPass() {
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
char & MachineCombinerID
This pass performs instruction combining using trace metrics to estimate critical-path and resource d...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
MCTargetOptions MCOptions
Machine level options.
FunctionPass * createPPCVSXSwapRemovalPass()
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with...
void initializePPCTLSDynamicCallPass(PassRegistry &)
static cl::opt< bool > DisableQPXLoadSplat("disable-ppc-qpx-load-splat", cl::Hidden, cl::desc("Disable QPX load splat simplification"))
Target & getThePPC32Target()
static cl::opt< bool > EnableMachineCombinerPass("ppc-machine-combiner", cl::desc("Enable the machine combiner pass"), cl::init(true), cl::Hidden)
static std::unique_ptr< TargetLoweringObjectFile > createTLOF(const Triple &TT)
char & RegisterCoalescerID
RegisterCoalescer - This pass merges live ranges to eliminate copies.
char & EarlyIfConverterID
EarlyIfConverter - This pass performs if-conversion on SSA form by inserting cmov instructions...
Analysis pass providing the TargetTransformInfo.
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
char & MachineSchedulerID
MachineScheduler - This pass schedules machine instructions.
static std::string computeFSAdditions(StringRef FS, CodeGenOpt::Level OL, const Triple &TT)
virtual void addMachineSSAOptimization()
addMachineSSAOptimization - Add standard passes that optimize machine instructions in SSA form...
bool hasAttribute(AttrKind Val) const
Return true if the attribute is present.
static const char * getManglingComponent(const Triple &T)
FunctionPass * createPPCTLSDynamicCallPass()
static cl::opt< bool > DisableVSXSwapRemoval("disable-ppc-vsx-swap-removal", cl::Hidden, cl::desc("Disable VSX Swap Removal for PPC"))
FunctionPass * createLoopDataPrefetchPass()
const Triple & getTargetTriple() const
bool isMacOSX() const
isMacOSX - Is this a Mac OS X triple.
FunctionPass * createPPCTOCRegDepsPass()
static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT, const TargetOptions &Options)
FunctionPass * createPPCCTRLoops()
This file contains the simple types necessary to represent the attributes associated with functions a...
No attributes have been set.
PPCTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
Target-Independent Code Generator Pass Configuration Options.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
FunctionPass * createPPCCTRLoopsVerify()
char & DeadMachineInstructionElimID
DeadMachineInstructionElim - This pass removes dead machine instructions.
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
FunctionPass * createPPCBoolRetToIntPass()
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
Target & getThePPC64Target()
FunctionPass * createPPCBranchSelectionPass()
char & LiveVariablesID
LiveVariables pass - This pass computes the set of blocks in which each variable is life and sets mac...
void initializePPCBoolRetToIntPass(PassRegistry &)
initializer< Ty > init(const Ty &Val)
const PPCSubtarget * getSubtargetImpl() const =delete
FunctionPass * createSeparateConstOffsetFromGEPPass(const TargetMachine *TM=nullptr, bool LowerGEP=false)
FunctionPass * createPPCEarlyReturnPass()
static cl::opt< bool > VSXFMAMutateEarly("schedule-ppc-vsx-fma-mutation-early", cl::Hidden, cl::desc("Schedule VSX FMA instruction mutation early"))
~PPCTargetMachine() override
static Reloc::Model getEffectiveRelocModel(Optional< Reloc::Model > RM)
void LLVMInitializePowerPCTarget()
static cl::opt< bool > DisableMIPeephole("disable-ppc-peephole", cl::Hidden, cl::desc("Disable machine peepholes for PPC"))
static bool is64Bit(const char *name)
void initializePPCVSXFMAMutatePass(PassRegistry &)
This class describes a target machine that is implemented with the LLVM target-independent code gener...
TargetIRAnalysis getTargetIRAnalysis() override
Get a TargetIRAnalysis implementation for the target.
Common code between 32-bit and 64-bit PowerPC targets.
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
FunctionPass * createPPCVSXCopyPass()
Triple - Helper class for working with autoconf configuration names.
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
static cl::opt< bool > EnablePrefetch("enable-ppc-prefetching", cl::desc("disable software prefetching on PPC"), cl::init(false), cl::Hidden)
void initializePPCExpandISELPass(PassRegistry &)
static cl::opt< bool > EnableGEPOpt("ppc-gep-opt", cl::Hidden, cl::desc("Enable optimizations on complex GEPs"), cl::init(true))
StringRef getABIName() const
getABIName - If this returns a non-empty string this represents the textual name of the ABI that we w...
Target - Wrapper for Target specific information.
Target & getThePPC64LETarget()
static cl::opt< bool > DisablePreIncPrep("disable-ppc-preinc-prep", cl::Hidden, cl::desc("Disable PPC loop preinc prep"))
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
static cl::opt< bool > DisableCTRLoops("disable-ppc-ctrloops", cl::Hidden, cl::desc("Disable CTR loops for PPC"))
FunctionPass * createPPCISelDag(PPCTargetMachine &TM, CodeGenOpt::Level OL)
createPPCISelDag - This pass converts a legalized DAG into a PowerPC-specific DAG, ready for instruction scheduling.
FunctionPass * createPPCQPXLoadSplatPass()
char & IfConverterID
IfConverter - This pass performs machine code if conversion.
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
static cl::opt< bool > EnableExtraTOCRegDeps("enable-ppc-extra-toc-reg-deps", cl::desc("Add extra TOC register dependencies"), cl::init(true), cl::Hidden)
StringRef getValueAsString() const
Return the attribute's value as a string.
FunctionPass * createPPCMIPeepholePass()
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
FunctionPass * createPPCLoopPreIncPrepPass(PPCTargetMachine &TM)
RegisterTargetMachine - Helper template for registering a target machine implementation, for use in the target machine initialization function.
static std::string getDataLayoutString(const Triple &T)
Return the datalayout string of a subtarget.
FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
StringRef - Represent a constant reference to a string, i.e.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
FunctionPass * createAtomicExpandPass()
FunctionPass * createPPCExpandISELPass()