1 //=- SystemZTargetMachine.h - Define TargetMachine for SystemZ ----*- C++ -*-=//
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
7 //===----------------------------------------------------------------------===//
9 // This file declares the SystemZ specific subclass of TargetMachine.
11 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETMACHINE_H
17 #include "SystemZSubtarget.h"
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/Analysis/TargetTransformInfo.h"
20 #include "llvm/CodeGen/CodeGenTargetMachineImpl.h"
21 #include "llvm/Support/CodeGen.h"
22 #include "llvm/Target/TargetMachine.h"
28 class SystemZTargetMachine
: public CodeGenTargetMachineImpl
{
29 std::unique_ptr
<TargetLoweringObjectFile
> TLOF
;
31 mutable StringMap
<std::unique_ptr
<SystemZSubtarget
>> SubtargetMap
;
34 SystemZTargetMachine(const Target
&T
, const Triple
&TT
, StringRef CPU
,
35 StringRef FS
, const TargetOptions
&Options
,
36 std::optional
<Reloc::Model
> RM
,
37 std::optional
<CodeModel::Model
> CM
, CodeGenOptLevel OL
,
39 ~SystemZTargetMachine() override
;
41 const SystemZSubtarget
*getSubtargetImpl(const Function
&) const override
;
42 // DO NOT IMPLEMENT: There is no such thing as a valid default subtarget,
43 // subtargets are per-function entities based on the target-specific
44 // attributes of each function.
45 const SystemZSubtarget
*getSubtargetImpl() const = delete;
47 // Override CodeGenTargetMachineImpl
48 TargetPassConfig
*createPassConfig(PassManagerBase
&PM
) override
;
49 TargetTransformInfo
getTargetTransformInfo(const Function
&F
) const override
;
51 TargetLoweringObjectFile
*getObjFileLowering() const override
{
56 createMachineFunctionInfo(BumpPtrAllocator
&Allocator
, const Function
&F
,
57 const TargetSubtargetInfo
*STI
) const override
;
59 bool targetSchedulesPostRAScheduling() const override
{ return true; };
62 } // end namespace llvm
64 #endif // LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETMACHINE_H