31 cl::desc(
"Disable CTR loops for PPC"));
35 cl::desc(
"Disable PPC loop preinc prep"));
43 cl::desc(
"Disable VSX Swap Removal for PPC"));
47 cl::desc(
"Enable optimizations on complex GEPs"),
52 cl::desc(
"disable software prefetching on PPC"),
57 cl::desc(
"Add extra TOC register dependencies"),
103 std::string FullFS = FS;
108 FullFS =
"+64bit," + FullFS;
115 FullFS =
"+crbits," + FullFS;
122 FullFS =
"+invariant-function-descriptors," + FullFS;
124 FullFS =
"+invariant-function-descriptors";
134 return make_unique<TargetLoweringObjectFileMachO>();
136 return make_unique<PPC64LinuxTargetObjectFile>();
147 "Unknown target-abi option!");
182 unsigned RefinementSteps = Subtarget.
hasRecipPrec() ? 1 : 3,
183 RefinementSteps64 = RefinementSteps + 1;
200 void PPC32TargetMachine::anchor() { }
209 void PPC64TargetMachine::anchor() { }
230 auto &
I = SubtargetMap[CPU +
FS];
236 I = llvm::make_unique<PPCSubtarget>(
261 return getTM<PPCTargetMachine>();
264 void addIRPasses()
override;
265 bool addPreISel()
override;
266 bool addILPOpts()
override;
267 bool addInstSelector()
override;
268 void addMachineSSAOptimization()
override;
269 void addPreRegAlloc()
override;
270 void addPreSched2()
override;
271 void addPreEmitPass()
override;
276 return new PPCPassConfig(
this, PM);
279 void PPCPassConfig::addIRPasses() {
284 bool UsePrefetching =
TM->getTargetTriple().getVendor() ==
Triple::BGQ &&
307 bool PPCPassConfig::addPreISel() {
317 bool PPCPassConfig::addILPOpts() {
322 bool PPCPassConfig::addInstSelector() {
335 void PPCPassConfig::addMachineSSAOptimization() {
344 void PPCPassConfig::addPreRegAlloc() {
348 if (getPPCTargetMachine().getRelocationModel() ==
Reloc::PIC_)
354 void PPCPassConfig::addPreSched2() {
359 void PPCPassConfig::addPreEmitPass() {
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
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...
const PPCSubtarget * getSubtargetImpl(const Function &F) const override
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
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.
std::string str() const
str - Get the contents as an std::string.
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"))
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.
Target-Independent Code Generator Pass Configuration Options.
FunctionPass * createPPCCTRLoopsVerify()
FunctionPass * createPPCLoopDataPrefetchPass()
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
FunctionPass * createPPCBranchSelectionPass()
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
void LLVMInitializePowerPCTarget()
static bool is64Bit(const char *name)
void initializePPCVSXFMAMutatePass(PassRegistry &)
TargetRecip Reciprocals
This class encapsulates options for reciprocal-estimate code generation.
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.
FunctionPass * createEarlyCSEPass()
PPCTargetMachine - Common code between 32-bit and 64-bit PowerPC targets.
PPC32TargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
FunctionPass * createPPCVSXCopyPass()
Triple - Helper class for working with autoconf configuration names.
bool hasRecipPrec() const
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 or iOS).
static cl::opt< bool > EnablePrefetch("enable-ppc-prefetching", cl::desc("disable software prefetching on PPC"), cl::init(false), cl::Hidden)
bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
FunctionPass * createPPCCTRLoops(PPCTargetMachine &TM)
static cl::opt< bool > EnableGEPOpt("ppc-gep-opt", cl::Hidden, cl::desc("Enable optimizations on complex GEPs"), cl::init(true))
Target - Wrapper for Target specific information.
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, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
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...
char & IfConverterID
IfConverter - This pass performs machine code if conversion.
PPCTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
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 * 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.
StringRef - Represent a constant reference to a string, i.e.
FunctionPass * createPPCISelDag(PPCTargetMachine &TM)
createPPCISelDag - This pass converts a legalized DAG into a PowerPC-specific DAG, ready for instruction scheduling.
void setDefaults(const StringRef &Key, bool Enable, unsigned RefSteps)
Set whether a particular reciprocal operation is enabled and how many refinement steps are needed whe...
bool empty() const
empty - Check if the string is empty.