33 cl::desc(
"Disable CTR loops for PPC"));
37 cl::desc(
"Disable PPC loop preinc prep"));
45 cl::desc(
"Disable VSX Swap Removal for PPC"));
49 cl::desc(
"Disable QPX load splat simplification"));
53 cl::desc(
"Disable machine peepholes for PPC"));
57 cl::desc(
"Enable optimizations on complex GEPs"),
62 cl::desc(
"disable software prefetching on PPC"),
67 cl::desc(
"Add extra TOC register dependencies"),
72 cl::desc(
"Enable the machine combiner pass"),
121 std::string FullFS = FS;
126 FullFS =
"+64bit," + FullFS;
133 FullFS =
"+crbits," + FullFS;
140 FullFS =
"+invariant-function-descriptors," + FullFS;
142 FullFS =
"+invariant-function-descriptors";
152 return make_unique<TargetLoweringObjectFileMachO>();
154 return make_unique<PPC64LinuxTargetObjectFile>();
165 "Unknown target-abi option!");
216 void PPC32TargetMachine::anchor() { }
226 void PPC64TargetMachine::anchor() { }
258 FS += FS.
empty() ?
"-hard-float" :
",-hard-float";
260 auto &
I = SubtargetMap[CPU + FS];
266 I = llvm::make_unique<PPCSubtarget>(
291 return getTM<PPCTargetMachine>();
294 void addIRPasses()
override;
295 bool addPreISel()
override;
296 bool addILPOpts()
override;
297 bool addInstSelector()
override;
298 void addMachineSSAOptimization()
override;
299 void addPreRegAlloc()
override;
300 void addPreSched2()
override;
301 void addPreEmitPass()
override;
306 return new PPCPassConfig(
this, PM);
309 void PPCPassConfig::addIRPasses() {
316 bool UsePrefetching =
TM->getTargetTriple().getVendor() ==
Triple::BGQ &&
339 bool PPCPassConfig::addPreISel() {
349 bool PPCPassConfig::addILPOpts() {
358 bool PPCPassConfig::addInstSelector() {
371 void PPCPassConfig::addMachineSSAOptimization() {
386 void PPCPassConfig::addPreRegAlloc() {
394 if (getPPCTargetMachine().isPositionIndependent()) {
406 void PPCPassConfig::addPreSched2() {
418 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...
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
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...
const PPCSubtarget * getSubtargetImpl(const Function &F) const override
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
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 * createAtomicExpandPass(const TargetMachine *TM)
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.
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
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)
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 &)
PPC32TargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
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)
FunctionPass * createPPCCTRLoops(PPCTargetMachine &TM)
static cl::opt< bool > EnableGEPOpt("ppc-gep-opt", cl::Hidden, cl::desc("Enable optimizations on complex GEPs"), cl::init(true))
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
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"))
PPC64TargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, CodeModel::Model CM, CodeGenOpt::Level OL)
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"))
StringRef getABIName() const
getABIName - If this returns a non-empty string this represents the textual name of the ABI that we w...
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 * createPPCISelDag(PPCTargetMachine &TM)
createPPCISelDag - This pass converts a legalized DAG into a PowerPC-specific DAG, ready for instruction scheduling.
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")