LLVM 24.0.0git
PPCTargetMachine.cpp
Go to the documentation of this file.
1//===-- PPCTargetMachine.cpp - Define TargetMachine for PowerPC -----------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Top-level implementation for the PowerPC target.
10//
11//===----------------------------------------------------------------------===//
12
13#include "PPCTargetMachine.h"
15#include "PPC.h"
17#include "PPCMachineScheduler.h"
18#include "PPCMacroFusion.h"
19#include "PPCSubtarget.h"
20#include "PPCTargetObjectFile.h"
23#include "llvm/ADT/StringRef.h"
30#include "llvm/CodeGen/Passes.h"
32#include "llvm/IR/Attributes.h"
33#include "llvm/IR/DataLayout.h"
34#include "llvm/IR/Function.h"
38#include "llvm/Pass.h"
45#include <cassert>
46#include <memory>
47#include <optional>
48#include <string>
49
50using namespace llvm;
51
88
90 const Triple &TT) {
91 std::string FullFS = std::string(FS);
92
93 // Make sure 64-bit features are available when CPUname is generic
94 if (TT.isPPC64()) {
95 if (!FullFS.empty())
96 FullFS = "+64bit," + FullFS;
97 else
98 FullFS = "+64bit";
99 }
100
101 if (OL >= CodeGenOptLevel::Default) {
102 if (!FullFS.empty())
103 FullFS = "+crbits," + FullFS;
104 else
105 FullFS = "+crbits";
106 }
107
108 if (OL != CodeGenOptLevel::None) {
109 if (!FullFS.empty())
110 FullFS = "+invariant-function-descriptors," + FullFS;
111 else
112 FullFS = "+invariant-function-descriptors";
113 }
114
115 if (TT.isOSAIX()) {
116 if (!FullFS.empty())
117 FullFS = "+aix," + FullFS;
118 else
119 FullFS = "+aix";
120 }
121
122 return FullFS;
123}
124
125static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
126 if (TT.isOSAIX())
127 return std::make_unique<TargetLoweringObjectFileXCOFF>();
128
129 return std::make_unique<PPC64LinuxTargetObjectFile>();
130}
131
132// An explicit ABI name takes precedence; otherwise use the triple default.
134 if (ABIName.starts_with("elfv1"))
135 return PPC_ABI_ELFv1;
136 if (ABIName.starts_with("elfv2"))
137 return PPC_ABI_ELFv2;
138
139 if (TT.isOSAIX())
140 return ABIName == "vec-extabi" ? PPC_ABI_AIX_EXTABI : PPC_ABI_UNKNOWN;
141
142 switch (TT.getArch()) {
143 case Triple::ppc64le:
144 return PPC_ABI_ELFv2;
145 case Triple::ppc64:
146 return TT.isPPC64ELFv2ABI() ? PPC_ABI_ELFv2 : PPC_ABI_ELFv1;
147 default:
148 return PPC_ABI_UNKNOWN;
149 }
150}
151
153 std::optional<Reloc::Model> RM) {
154 if (TT.isOSAIX() && RM && *RM != Reloc::PIC_)
155 report_fatal_error("invalid relocation model, AIX only supports PIC",
156 false);
157
158 if (RM)
159 return *RM;
160
161 // Big Endian PPC and AIX default to PIC.
162 if (TT.getArch() == Triple::ppc64 || TT.isOSAIX())
163 return Reloc::PIC_;
164
165 // Rest are static by default.
166 return Reloc::Static;
167}
168
169static CodeModel::Model
170getEffectivePPCCodeModel(const Triple &TT, std::optional<CodeModel::Model> CM,
171 bool JIT) {
172 if (CM) {
173 if (*CM == CodeModel::Tiny)
174 report_fatal_error("Target does not support the tiny CodeModel", false);
175 if (*CM == CodeModel::Kernel)
176 report_fatal_error("Target does not support the kernel CodeModel", false);
177 return *CM;
178 }
179
180 if (JIT)
181 return CodeModel::Small;
182 if (TT.isOSAIX()) {
183 // Use large code model for 64-bit AIX by default.
184 if (TT.isArch64Bit())
185 return CodeModel::Large;
186 return CodeModel::Small;
187 }
188
189 assert(TT.isOSBinFormatELF() && "All remaining PPC OSes are ELF based.");
190
191 if (TT.isArch32Bit())
192 return CodeModel::Small;
193
194 assert(TT.isArch64Bit() && "Unsupported PPC architecture.");
195 return CodeModel::Medium;
196}
197
198
200 const PPCSubtarget &ST = C->MF->getSubtarget<PPCSubtarget>();
201 ScheduleDAGMILive *DAG = ST.usePPCPreRASchedStrategy()
204 // add DAG Mutations here.
205 if (ST.hasStoreFusion())
206 DAG->addMutation(createStoreClusterDAGMutation(DAG->TII));
207 if (ST.hasFusion())
208 DAG->addMutation(createPowerPCMacroFusionDAGMutation());
209
210 return DAG;
211}
212
213static ScheduleDAGInstrs *
215 const PPCSubtarget &ST = C->MF->getSubtarget<PPCSubtarget>();
216 ScheduleDAGMI *DAG = ST.usePPCPostRASchedStrategy()
219 // add DAG Mutations here.
220 if (ST.hasStoreFusion())
221 DAG->addMutation(createStoreClusterDAGMutation(DAG->TII));
222 if (ST.hasFusion())
223 DAG->addMutation(createPowerPCMacroFusionDAGMutation());
224 return DAG;
225}
226
227// The FeatureString here is a little subtle. We are modifying the feature
228// string with what are (currently) non-function specific overrides as it goes
229// into the CodeGenTargetMachineImpl constructor and then using the stored value
230// in the Subtarget constructor below it.
232 StringRef CPU, StringRef FS,
233 const TargetOptions &Options,
234 std::optional<Reloc::Model> RM,
235 std::optional<CodeModel::Model> CM,
236 CodeGenOptLevel OL, bool JIT)
237 : CodeGenTargetMachineImpl(T, TT, CPU, computeFSAdditions(FS, OL, TT),
239 getEffectivePPCCodeModel(TT, CM, JIT), OL),
240 CLOpts(cl::LibraryOptionsContext::get<PPCOptions>(
241 Options.MCOptions.LibraryOptions)),
243 Endianness(TT.isLittleEndian() ? Endian::LITTLE : Endian::BIG) {
244 initAsmInfo();
245}
246
248
249const PPCSubtarget *
251 Attribute CPUAttr = F.getFnAttribute("target-cpu");
252 Attribute TuneAttr = F.getFnAttribute("tune-cpu");
253 Attribute FSAttr = F.getFnAttribute("target-features");
254
255 std::string CPU =
256 CPUAttr.isValid() ? CPUAttr.getValueAsString().str() : TargetCPU;
257 std::string TuneCPU =
258 TuneAttr.isValid() ? TuneAttr.getValueAsString().str() : CPU;
259 std::string FS =
260 FSAttr.isValid() ? FSAttr.getValueAsString().str() : TargetFS;
261
262 // FIXME: This is related to the code below to reset the target options,
263 // we need to know whether or not the soft float flag is set on the
264 // function before we can generate a subtarget. We also need to use
265 // it as a key for the subtarget since that can be the only difference
266 // between two functions.
267 bool SoftFloat = F.getFnAttribute("use-soft-float").getValueAsBool();
268 // If the soft float attribute is set on the function turn on the soft float
269 // subtarget feature.
270 if (SoftFloat)
271 FS += FS.empty() ? "-hard-float" : ",-hard-float";
272
273 // Prefer the "target-abi" module flag, falling back to the -target-abi
274 // option.
275 StringRef ABIName = getTargetABIName(*F.getParent());
276
277 auto &I = SubtargetMap[CPU + TuneCPU + FS + ABIName.str()];
278 if (!I) {
279 I = std::make_unique<PPCSubtarget>(
280 TargetTriple, CPU, TuneCPU,
281 // FIXME: It would be good to have the subtarget additions here
282 // not necessary. Anything that turns them on/off (overrides) ends
283 // up being put at the end of the feature string, but the defaults
284 // shouldn't require adding them. Fixing this means pulling Feature64Bit
285 // out of most of the target cpus in the .td file and making it set only
286 // as part of initialization via the TargetTriple.
288 *this);
289 }
290 return I.get();
291}
292
297
302
303//===----------------------------------------------------------------------===//
304// Pass Pipeline Configuration
305//===----------------------------------------------------------------------===//
306
307namespace {
308
309/// PPC Code Generator Pass Configuration Options.
310class PPCPassConfig : public TargetPassConfig {
311 const PPCOptions &CLOpts;
312
313public:
314 PPCPassConfig(PPCTargetMachine &TM, PassManagerBase &PM)
315 : TargetPassConfig(TM, PM), CLOpts(TM.getCLOpts()) {
316 // At any optimization level above -O0 we use the Machine Scheduler and not
317 // the default Post RA List Scheduler.
319 substitutePass(&PostRASchedulerID, &PostMachineSchedulerID);
320 }
321
322 PPCTargetMachine &getPPCTargetMachine() const {
324 }
325
326 void addIRPasses() override;
327 bool addPreISel() override;
328 bool addILPOpts() override;
329 bool addInstSelector() override;
330 void addMachineSSAOptimization() override;
331 void addPreRegAlloc() override;
332 void addPreSched2() override;
333 void addPreEmitPass() override;
334 void addPreEmitPass2() override;
335 // GlobalISEL
336 bool addIRTranslator() override;
337 bool addLegalizeMachineIR() override;
338 bool addRegBankSelect() override;
339 bool addGlobalInstructionSelect() override;
340};
341
342} // end anonymous namespace
343
345 return new PPCPassConfig(*this, PM);
346}
347
348void PPCPassConfig::addIRPasses() {
349 if (TM->getOptLevel() != CodeGenOptLevel::None)
350 addPass(createPPCBoolRetToIntPass());
352
353 // Lower generic MASSV routines to PowerPC subtarget-specific entries.
355
356 // Generate PowerPC target-specific entries for scalar math functions
357 // that are available in IBM MASS (scalar) library.
358 if (TM->getOptLevel() == CodeGenOptLevel::Aggressive && CLOpts.scalar_mass)
360
361 // If explicitly requested, add explicit data prefetch intrinsics.
362 if (CLOpts.prefetching != BoolOrDefault::Default)
364
365 if (TM->getOptLevel() >= CodeGenOptLevel::Default && CLOpts.gep_opt) {
366 // Call SeparateConstOffsetFromGEP pass to extract constants within indices
367 // and lower a GEP with multiple indices to either arithmetic operations or
368 // multiple GEPs with single index.
370 // Call EarlyCSE pass to find and remove subexpressions in the lowered
371 // result.
372 addPass(createEarlyCSEPass());
373 // Do loop invariant code motion in case part of the lowered result is
374 // invariant.
375 addPass(createLICMPass());
376 }
377
378 if (TM->getTargetTriple().isOSAIX())
380
382}
383
384bool PPCPassConfig::addPreISel() {
385 // The GlobalMerge pass is intended to be on by default on AIX.
386 // Specifying the command line option overrides the AIX default.
387 if (valueOr(CLOpts.global_merge, getOptLevel() != CodeGenOptLevel::None))
388 addPass(createGlobalMergePass(TM, CLOpts.global_merge_max_offset, false,
389 false, true, true));
390
391 if (CLOpts.instr_form_prep && getOptLevel() != CodeGenOptLevel::None)
392 addPass(createPPCLoopInstrFormPrepPass(getPPCTargetMachine()));
393
394 if (CLOpts.ctr_loops && getOptLevel() != CodeGenOptLevel::None)
396
397 return false;
398}
399
400bool PPCPassConfig::addILPOpts() {
401 addPass(&EarlyIfConverterLegacyID);
402
403 if (CLOpts.machine_combiner)
404 addPass(&MachineCombinerID);
405
406 return true;
407}
408
409bool PPCPassConfig::addInstSelector() {
410 // Install an instruction selector.
411 addPass(createPPCISelDag(getPPCTargetMachine(), getOptLevel()));
412
413#ifndef NDEBUG
414 if (CLOpts.ctr_loops && getOptLevel() != CodeGenOptLevel::None)
415 addPass(createPPCCTRLoopsVerify());
416#endif
417
418 addPass(createPPCVSXWACCCopyPass());
419 return false;
420}
421
422void PPCPassConfig::addMachineSSAOptimization() {
423 // Run CTR loops pass before any cfg modification pass to prevent the
424 // canonical form of hardware loop from being destroied.
425 if (CLOpts.ctr_loops && getOptLevel() != CodeGenOptLevel::None)
426 addPass(createPPCCTRLoopsPass());
427
428 // PPCBranchCoalescingPass need to be done before machine sinking
429 // since it merges empty blocks.
430 if (CLOpts.branch_coalesce && getOptLevel() != CodeGenOptLevel::None)
433 // For little endian, remove where possible the vector swap instructions
434 // introduced at code generation to normalize vector element order.
435 if (TM->getTargetTriple().getArch() == Triple::ppc64le &&
436 CLOpts.vsx_swap_removal)
438 // Reduce the number of cr-logical ops.
439 if (CLOpts.reduce_cr_logicals && getOptLevel() != CodeGenOptLevel::None)
441 // Target-specific peephole cleanups performed after instruction
442 // selection.
443 if (CLOpts.peephole) {
444 addPass(createPPCMIPeepholePass());
446 }
447}
448
449void PPCPassConfig::addPreRegAlloc() {
450 if (getOptLevel() != CodeGenOptLevel::None) {
451 insertPass(CLOpts.schedule_vsx_fma_mutation_early
455 }
456
457 // FIXME: We probably don't need to run these for -fPIE.
458 if (getPPCTargetMachine().isPositionIndependent())
460 if (CLOpts.extra_toc_reg_deps)
461 addPass(createPPCTOCRegDepsPass());
462}
463
464void PPCPassConfig::addPreSched2() {
465 if (getOptLevel() != CodeGenOptLevel::None)
466 addPass(&IfConverterID);
467}
468
469void PPCPassConfig::addPreEmitPass() {
471
472 if (getOptLevel() != CodeGenOptLevel::None)
473 addPass(createPPCEarlyReturnPass());
474}
475
476void PPCPassConfig::addPreEmitPass2() {
477 // Schedule the expansion of AMOs at the last possible moment, avoiding the
478 // possibility for other passes to break the requirements for forward
479 // progress in the LL/SC block.
481 // Must run branch selection immediately preceding the asm printer.
483}
484
487 return TargetTransformInfo(std::make_unique<PPCTTIImpl>(this, F));
488}
489
491 assert(Endianness != Endian::NOT_DETECTED &&
492 "Unable to determine endianness");
493 return Endianness == Endian::LITTLE;
494}
495
497 BumpPtrAllocator &Allocator, const Function &F,
498 const TargetSubtargetInfo *STI) const {
500 Allocator, F, static_cast<const PPCSubtarget *>(STI));
501}
502
505 "Run PowerPC PreRA specific scheduler",
507
510 "Run PowerPC PostRA specific scheduler",
512
513// Global ISEL
514bool PPCPassConfig::addIRTranslator() {
515 addPass(new IRTranslatorLegacy());
516 return false;
517}
518
519bool PPCPassConfig::addLegalizeMachineIR() {
520 addPass(new LegalizerLegacy());
521 return false;
522}
523
524bool PPCPassConfig::addRegBankSelect() {
525 addPass(new RegBankSelectLegacy());
526 return false;
527}
528
529bool PPCPassConfig::addGlobalInstructionSelect() {
530 addPass(new InstructionSelectLegacy(getOptLevel()));
531 return false;
532}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static std::unique_ptr< TargetLoweringObjectFile > createTLOF(const Triple &TT)
static Reloc::Model getEffectiveRelocModel()
This file contains the simple types necessary to represent the attributes associated with functions a...
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define LLVM_ABI
Definition Compiler.h:211
#define LLVM_EXTERNAL_VISIBILITY
Definition Compiler.h:132
This file declares the IRTranslator pass.
#define F(x, y, z)
Definition MD5.cpp:54
#define I(x, y, z)
Definition MD5.cpp:57
#define T
static MachineSchedRegistry PPCPostRASchedRegistry("ppc-postra", "Run PowerPC PostRA specific scheduler", createPPCPostMachineScheduler)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializePowerPCTarget()
static ScheduleDAGInstrs * createPPCPostMachineScheduler(MachineSchedContext *C)
static CodeModel::Model getEffectivePPCCodeModel(const Triple &TT, std::optional< CodeModel::Model > CM, bool JIT)
static std::string computeFSAdditions(StringRef FS, CodeGenOptLevel OL, const Triple &TT)
static MachineSchedRegistry PPCPreRASchedRegistry("ppc-prera", "Run PowerPC PreRA specific scheduler", createPPCMachineScheduler)
static ScheduleDAGInstrs * createPPCMachineScheduler(MachineSchedContext *C)
This file a TargetTransformInfoImplBase conforming object specific to the PPC target machine.
This file describes the interface of the MachineFunctionPass responsible for assigning the generic vi...
const GCNTargetMachine & getTM(const GCNSubtarget *STI)
Target-Independent Code Generator Pass Configuration Options pass.
This pass exposes codegen information to IR-level passes.
static std::unique_ptr< TargetLoweringObjectFile > createTLOF()
Functions, function parameters, and return types can have attributes to indicate how they should be t...
Definition Attributes.h:107
LLVM_ABI StringRef getValueAsString() const
Return the attribute's value as a string.
bool isValid() const
Return true if the attribute is any kind of attribute.
Definition Attributes.h:263
CodeGenTargetMachineImpl(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOptLevel OL)
This pass is responsible for selecting generic machine instructions to target-specific instructions.
MachineSchedRegistry provides a selection of available machine instruction schedulers.
Common code between 32-bit and 64-bit PowerPC targets.
static PPCABI computeABI(const Triple &TT, StringRef ABIName)
Compute the ABI variant for TT and ABIName (the "target-abi" module flag), falling back to the triple...
ScheduleDAGInstrs * createPostMachineScheduler(MachineSchedContext *C) const override
Similar to createMachineScheduler but used when postRA machine scheduling is enabled.
const PPCSubtarget * getSubtargetImpl() const =delete
~PPCTargetMachine() override
PPCTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM, CodeGenOptLevel OL, bool JIT)
TargetTransformInfo getTargetTransformInfo(const Function &F) const override
Get a TargetTransformInfo implementation for the target.
ScheduleDAGInstrs * createMachineScheduler(MachineSchedContext *C) const override
Create an instance of ScheduleDAGInstrs to be run within the standard MachineScheduler pass for this ...
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
MachineFunctionInfo * createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F, const TargetSubtargetInfo *STI) const override
Create the target's instance of MachineFunctionInfo.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
static LLVM_ABI PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
This pass implements the reg bank selector pass used in the GlobalISel pipeline.
A ScheduleDAG for scheduling lists of MachineInstr.
ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that schedules machine instructions while...
ScheduleDAGMI is an implementation of ScheduleDAGInstrs that simply schedules machine instructions ac...
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
std::string str() const
Get the contents as an std::string.
Definition StringRef.h:222
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
Definition StringRef.h:258
CodeGenOptLevel getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with.
const Triple & getTargetTriple() const
StringRef getTargetABIName(const Module &M) const
Returns the effective target ABI name: the "target-abi" module flag if present, otherwise the -target...
std::unique_ptr< const MCSubtargetInfo > STI
TargetOptions Options
Target-Independent Code Generator Pass Configuration Options.
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
virtual void addMachineSSAOptimization()
addMachineSSAOptimization - Add standard passes that optimize machine instructions in SSA form.
TargetSubtargetInfo - Generic base class for all target subtargets.
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
Registers T with cl::parseCommandLineOptions.
This namespace contains all of the command line option processing machinery.
This is an optimization pass for GlobalISel generic memory operations.
ScheduleDAGMILive * createSchedLive(MachineSchedContext *C)
Create the standard converging machine scheduler.
FunctionPass * createPPCPreEmitPeepholePass()
Target & getThePPC64LETarget()
void initializePPCTLSDynamicCallPass(PassRegistry &)
FunctionPass * createPPCLoopInstrFormPrepPass(PPCTargetMachine &TM)
void initializePPCVSXFMAMutatePass(PassRegistry &)
void initializePPCLowerMASSVEntriesPass(PassRegistry &)
LLVM_ABI Pass * createGlobalMergePass(const TargetMachine *TM, unsigned MaximalOffset, bool OnlyOptimizeForSize=false, bool MergeExternalByDefault=false, bool MergeConstantByDefault=false, bool MergeConstAggressiveByDefault=false)
GlobalMerge - This pass merges internal (by default) globals into structs to enable reuse of a base p...
LLVM_ABI char & PostRASchedulerID
PostRAScheduler - This pass performs post register allocation scheduling.
Target & getThePPC32Target()
FunctionPass * createPPCCTRLoopsPass()
LLVM_ABI char & MachineSchedulerID
MachineScheduler - This pass schedules machine instructions.
FunctionPass * createPPCTLSDynamicCallPass()
LLVM_ABI char & PostMachineSchedulerID
PostMachineScheduler - This pass schedules machine instructions postRA.
LLVM_ABI std::unique_ptr< ScheduleDAGMutation > createStoreClusterDAGMutation(const TargetInstrInfo *TII, bool ReorderWhileClustering=false)
If ReorderWhileClustering is set to true, no attempt will be made to reduce reordering due to store c...
LLVM_ABI Pass * createLICMPass()
Definition LICM.cpp:346
FunctionPass * createPPCEarlyReturnPass()
void initializePPCPreEmitPeepholePass(PassRegistry &)
LLVM_ABI char & EarlyIfConverterLegacyID
EarlyIfConverter - This pass performs if-conversion on SSA form by inserting cmov instructions.
FunctionPass * createPPCExpandAtomicPseudoPass()
void initializePPCTOCRegDepsPass(PassRegistry &)
void initializePPCReduceCRLogicalsPass(PassRegistry &)
LLVM_ABI char & MachineCombinerID
This pass performs instruction combining using trace metrics to estimate critical-path and resource d...
static Reloc::Model getEffectiveRelocModel(std::optional< Reloc::Model > RM)
ModulePass * createPPCPrepareIFuncsOnAIXPass()
ScheduleDAGMI * createSchedPostRA(MachineSchedContext *C)
Create a generic scheduler with no vreg liveness or DAG mutation passes.
void initializePPCCTRLoopsVerifyPass(PassRegistry &)
FunctionPass * createPPCVSXSwapRemovalPass()
void initializePPCAIXAsmPrinterPass(PassRegistry &)
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
void initializePPCCTRLoopsPass(PassRegistry &)
ModulePass * createPPCLowerMASSVEntriesPass()
LLVM_ABI FunctionPass * createLoopDataPrefetchPass()
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
Definition Error.cpp:163
void initializePPCDAGToDAGISelLegacyPass(PassRegistry &)
ModulePass * createPPCGenScalarMASSEntriesPass()
void initializePPCEarlyReturnPass(PassRegistry &)
CodeGenOptLevel
Code generation optimization level.
Definition CodeGen.h:280
@ Default
-O2, -Os, -Oz
Definition CodeGen.h:283
void initializePPCGenScalarMASSEntriesPass(PassRegistry &)
FunctionPass * createPPCReduceCRLogicalsPass()
FunctionPass * createPPCISelDag(PPCTargetMachine &TM, CodeGenOptLevel OL)
createPPCISelDag - This pass converts a legalized DAG into a PowerPC-specific DAG,...
void initializePPCExpandAtomicPseudoPass(PassRegistry &)
LLVM_ABI FunctionPass * createSeparateConstOffsetFromGEPPass(bool LowerGEP=false)
FunctionPass * createPPCBranchCoalescingPass()
createPPCBranchCoalescingPass - returns an instance of the Branch Coalescing Pass
Target & getThePPC64Target()
void initializePPCVSXWACCCopyPass(PassRegistry &)
void initializePPCLinuxAsmPrinterPass(PassRegistry &)
LLVM_ABI void initializeGlobalISel(PassRegistry &)
Initialize all passes linked into the GlobalISel library.
void initializePPCBSelPass(PassRegistry &)
FunctionPass * createPPCTOCRegDepsPass()
FunctionPass * createPPCCTRLoopsVerify()
void initializePPCBranchCoalescingPass(PassRegistry &)
void initializePPCBoolRetToIntPass(PassRegistry &)
void initializePPCMIPeepholePass(PassRegistry &)
std::unique_ptr< ScheduleDAGMutation > createPowerPCMacroFusionDAGMutation()
Note that you have to add: DAG.addMutation(createPowerPCMacroFusionDAGMutation()); to PPCTargetMachin...
void initializePPCVSXSwapRemovalPass(PassRegistry &)
Target & getThePPC32LETarget()
char & PPCVSXFMAMutateID
constexpr bool valueOr(BoolOrDefault X, bool Default)
LLVM_ABI char & IfConverterID
IfConverter - This pass performs machine code if conversion.
void initializePPCLoopInstrFormPrepPass(PassRegistry &)
FunctionPass * createPPCVSXWACCCopyPass()
LLVM_ABI char & TwoAddressInstructionPassID
TwoAddressInstruction - This pass reduces two-address instructions to use two operands.
LLVM_ABI FunctionPass * createAtomicExpandLegacyPass()
AtomicExpandPass - At IR level this pass replace atomic instructions with __atomic_* library calls,...
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Definition Allocator.h:391
LLVM_ABI FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
void initializePPCPrepareIFuncsOnAIXPass(PassRegistry &)
PPCABI
The PowerPC ABI variant.
Definition PPC.h:101
@ PPC_ABI_UNKNOWN
Definition PPC.h:102
@ PPC_ABI_ELFv2
Definition PPC.h:104
@ PPC_ABI_AIX_EXTABI
Definition PPC.h:105
@ PPC_ABI_ELFv1
Definition PPC.h:103
FunctionPass * createPPCBranchSelectionPass()
FunctionPass * createPPCBoolRetToIntPass()
LLVM_ABI char & DeadMachineInstructionElimID
DeadMachineInstructionElim - This pass removes dead machine instructions.
LLVM_ABI FunctionPass * createHardwareLoopsLegacyPass()
Create Hardware Loop pass.
FunctionPass * createPPCMIPeepholePass()
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
static FuncInfoTy * create(BumpPtrAllocator &Allocator, const Function &F, const SubtargetTy *STI)
Factory function: default behavior is to call new using the supplied allocator.
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
RegisterTargetMachine - Helper template for registering a target machine implementation,...