36 cl::desc(
"Enable the machine combiner pass"),
41 cl::desc(
"Run the generic pre-ra scheduler instead of the SystemZ "
64 return std::make_unique<TargetLoweringObjectFileGOFF>();
68 return std::make_unique<SystemZELFTargetObjectFile>();
72 std::optional<Reloc::Model> RM) {
142 std::optional<Reloc::Model>
RM,
143 std::optional<CodeModel::Model> CM,
158 const Module *M =
F.getParent();
162 SubtargetAttrs Attrs;
166 Attrs.SoftFloat = FnAttrs.
getAttribute(
"use-soft-float");
173 Attrs.CPU.isValid() ? Attrs.CPU.getValueAsString().str() :
TargetCPU;
174 std::string TuneCPU =
175 Attrs.TuneCPU.isValid() ? Attrs.TuneCPU.getValueAsString().str() : CPU;
177 Attrs.FS.isValid() ? Attrs.FS.getValueAsString().str() :
TargetFS;
182 bool SoftFloat = Attrs.SoftFloat.getValueAsBool();
184 FS += FS.empty() ?
"+soft-float" :
",+soft-float";
185 bool BackChain = Attrs.BackChain.isValid();
187 FS += FS.empty() ?
"+backchain" :
",+backchain";
189 auto &
I = SubtargetMap[CPU + TuneCPU + FS];
191 I = std::make_unique<SystemZSubtarget>(
TargetTriple, CPU, TuneCPU, FS,
195 LastSubtarget.set(FnAttrs, M, Attrs,
I.get());
204 !
C->MF->getSubtarget().getSchedModel().hasInstrSchedModel())
227 void addIRPasses()
override;
228 bool addInstSelector()
override;
229 bool addILPOpts()
override;
230 void addPreRegAlloc()
override;
231 void addPostRewrite()
override;
232 void addPostRegAlloc()
override;
233 void addPreSched2()
override;
234 void addPreEmitPass()
override;
239void SystemZPassConfig::addIRPasses() {
251bool SystemZPassConfig::addInstSelector() {
261bool SystemZPassConfig::addILPOpts() {
270void SystemZPassConfig::addPreRegAlloc() {
274void SystemZPassConfig::addPostRewrite() {
278void SystemZPassConfig::addPostRegAlloc() {
285void SystemZPassConfig::addPreSched2() {
290void SystemZPassConfig::addPreEmitPass() {
332 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
static cl::opt< bool > EnableMachineCombinerPass("ppc-machine-combiner", cl::desc("Enable the machine combiner pass"), cl::init(true), cl::Hidden)
const GCNTargetMachine & getTM(const GCNSubtarget *STI)
static CodeModel::Model getEffectiveSystemZCodeModel(std::optional< CodeModel::Model > CM, Reloc::Model RM, bool JIT)
static cl::opt< bool > GenericSched("generic-sched", cl::Hidden, cl::init(false), cl::desc("Run the generic pre-ra scheduler instead of the SystemZ " "scheduler."))
cl::opt< bool > EnableMachineCombinerPass("systemz-machine-combiner", cl::desc("Enable the machine combiner pass"), cl::init(true), cl::Hidden)
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 ...
initializer< Ty > init(const Ty &Val)
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.
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,...