56 return std::make_unique<TargetLoweringObjectFileGOFF>();
60 return std::make_unique<SystemZELFTargetObjectFile>();
64 std::optional<Reloc::Model> RM) {
134 std::optional<Reloc::Model>
RM,
135 std::optional<CodeModel::Model> CM,
141 CLOpts(
cl::LibraryOptionsContext::
get<SystemZOptions>(
142 Options.MCOptions.LibraryOptions)),
152 const Module *M =
F.getParent();
156 SubtargetAttrs Attrs;
160 Attrs.SoftFloat = FnAttrs.
getAttribute(
"use-soft-float");
167 Attrs.CPU.isValid() ? Attrs.CPU.getValueAsString().str() :
TargetCPU;
168 std::string TuneCPU =
169 Attrs.TuneCPU.isValid() ? Attrs.TuneCPU.getValueAsString().str() : CPU;
171 Attrs.FS.isValid() ? Attrs.FS.getValueAsString().str() :
TargetFS;
176 bool SoftFloat = Attrs.SoftFloat.getValueAsBool();
178 FS += FS.empty() ?
"+soft-float" :
",+soft-float";
179 bool BackChain = Attrs.BackChain.isValid();
181 FS += FS.empty() ?
"+backchain" :
",+backchain";
183 auto &
I = SubtargetMap[CPU + TuneCPU + FS];
185 I = std::make_unique<SystemZSubtarget>(
TargetTriple, CPU, TuneCPU, FS,
189 LastSubtarget.set(FnAttrs, M, Attrs,
I.get());
197 if (CLOpts.generic_sched ||
198 !
C->MF->getSubtarget().getSchedModel().hasInstrSchedModel())
221 void addIRPasses()
override;
222 bool addInstSelector()
override;
223 bool addILPOpts()
override;
224 void addPreRegAlloc()
override;
225 void addPostRewrite()
override;
226 void addPostRegAlloc()
override;
227 void addPreSched2()
override;
228 void addPreEmitPass()
override;
233void SystemZPassConfig::addIRPasses() {
245bool SystemZPassConfig::addInstSelector() {
255bool SystemZPassConfig::addILPOpts() {
258 if (getSystemZTargetMachine().
getCLOpts().machine_combiner)
264void SystemZPassConfig::addPreRegAlloc() {
268void SystemZPassConfig::addPostRewrite() {
272void SystemZPassConfig::addPostRegAlloc() {
279void SystemZPassConfig::addPreSched2() {
284void SystemZPassConfig::addPreEmitPass() {
326 return new SystemZPassConfig(*
this, PM);
static std::unique_ptr< TargetLoweringObjectFile > createTLOF(const Triple &TT)
static Reloc::Model getEffectiveRelocModel()
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
#define LLVM_EXTERNAL_VISIBILITY
const GCNTargetMachine & getTM(const GCNSubtarget *STI)
static CodeModel::Model getEffectiveSystemZCodeModel(std::optional< CodeModel::Model > CM, Reloc::Model RM, bool JIT)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSystemZTarget()
Target-Independent Code Generator Pass Configuration Options pass.
static std::unique_ptr< TargetLoweringObjectFile > createTLOF()
This class holds the attributes for a particular argument, parameter, function, or return value.
LLVM_ABI Attribute getAttribute(Attribute::AttrKind Kind) const
Return the attribute object.
CodeGenTargetMachineImpl(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOptLevel OL)
A Module instance is used to store all the information related to an LLVM module.
static LLVM_ABI PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A ScheduleDAG for scheduling lists of MachineInstr.
Represent a constant reference to a string, i.e.
ScheduleDAGInstrs * createMachineScheduler(MachineSchedContext *C) const override
Create an instance of ScheduleDAGInstrs to be run within the standard MachineScheduler pass for this ...
const SystemZSubtarget * getSubtargetImpl() const =delete
SystemZTargetMachine(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.
MachineFunctionInfo * createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F, const TargetSubtargetInfo *STI) const override
Create the target's instance of MachineFunctionInfo.
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
ScheduleDAGInstrs * createPostMachineScheduler(MachineSchedContext *C) const override
Similar to createMachineScheduler but used when postRA machine scheduling is enabled.
~SystemZTargetMachine() override
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with.
const Triple & getTargetTriple() const
std::unique_ptr< const MCSubtargetInfo > STI
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...
TargetSubtargetInfo - Generic base class for all target subtargets.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
Registers T with cl::parseCommandLineOptions.
const AArch64MCOptions & getCLOpts(const MCTargetOptions &Options)
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.
Target & getTheSystemZTarget()
FunctionPass * createSystemZISelDagLegacyPass(SystemZTargetMachine &TM, CodeGenOptLevel OptLevel)
void initializeSystemZPostRewriteLegacyPass(PassRegistry &)
FunctionPass * createSystemZLDCleanupLegacyPass(SystemZTargetMachine &TM)
void initializeSystemZCopyPhysRegsLegacyPass(PassRegistry &)
LLVM_ABI char & PostMachineSchedulerID
PostMachineScheduler - This pass schedules machine instructions postRA.
LLVM_ABI char & EarlyIfConverterLegacyID
EarlyIfConverter - This pass performs if-conversion on SSA form by inserting cmov instructions.
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)
void initializeSystemZDAGToDAGISelLegacyPass(PassRegistry &)
void initializeSystemZTDCLegacyPass(PassRegistry &)
ScheduleDAGMI * createSchedPostRA(MachineSchedContext *C)
Create a generic scheduler with no vreg liveness or DAG mutation passes.
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
void initializeSystemZAlignGlobalsLegacyPass(PassRegistry &)
LLVM_ABI FunctionPass * createLoopDataPrefetchPass()
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
FunctionPass * createSystemZTDCLegacyPass()
FunctionPass * createSystemZCopyPhysRegsLegacyPass(SystemZTargetMachine &TM)
void initializeSystemZLDCleanupLegacyPass(PassRegistry &)
void initializeSystemZElimCompareLegacyPass(PassRegistry &)
CodeGenOptLevel
Code generation optimization level.
void initializeSystemZAsmPrinterPass(PassRegistry &)
FunctionPass * createSystemZShortenInstLegacyPass(SystemZTargetMachine &TM)
ModulePass * createSystemZAlignGlobalsLegacyPass()
LLVM_ABI char & IfConverterID
IfConverter - This pass performs machine code if conversion.
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.
FunctionPass * createSystemZPostRewriteLegacyPass(SystemZTargetMachine &TM)
void initializeSystemZLongBranchLegacyPass(PassRegistry &)
FunctionPass * createSystemZElimCompareLegacyPass(SystemZTargetMachine &TM)
FunctionPass * createSystemZLongBranchLegacyPass(SystemZTargetMachine &TM)
void initializeSystemZShortenInstLegacyPass(PassRegistry &)
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,...