blob: a10ca64fa6329d3045bc04e3d606980e17ffd21c [file] [log] [blame]
Eugene Zelenko3943d2b2017-01-24 22:10:43 +00001//=- SystemZTargetMachine.h - Define TargetMachine for SystemZ ----*- C++ -*-=//
Ulrich Weigand5f613df2013-05-06 16:15:19 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file declares the SystemZ specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000015#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETMACHINE_H
16#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETMACHINE_H
Ulrich Weigand5f613df2013-05-06 16:15:19 +000017
Chandler Carruth8a8cd2b2014-01-07 11:48:04 +000018#include "SystemZSubtarget.h"
Eugene Zelenko3943d2b2017-01-24 22:10:43 +000019#include "llvm/ADT/Optional.h"
20#include "llvm/ADT/StringRef.h"
21#include "llvm/Analysis/TargetTransformInfo.h"
22#include "llvm/Support/CodeGen.h"
Ulrich Weigand5f613df2013-05-06 16:15:19 +000023#include "llvm/Target/TargetMachine.h"
Eugene Zelenko3943d2b2017-01-24 22:10:43 +000024#include <memory>
Ulrich Weigand5f613df2013-05-06 16:15:19 +000025
26namespace llvm {
27
28class SystemZTargetMachine : public LLVMTargetMachine {
Aditya Nandakumara2719322014-11-13 09:26:31 +000029 std::unique_ptr<TargetLoweringObjectFile> TLOF;
Eugene Zelenko3943d2b2017-01-24 22:10:43 +000030 SystemZSubtarget Subtarget;
Ulrich Weigand5f613df2013-05-06 16:15:19 +000031
32public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000033 SystemZTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
Ulrich Weigand5f613df2013-05-06 16:15:19 +000034 StringRef FS, const TargetOptions &Options,
Rafael Espindola8c34dd82016-05-18 22:04:49 +000035 Optional<Reloc::Model> RM, CodeModel::Model CM,
Ulrich Weigand5f613df2013-05-06 16:15:19 +000036 CodeGenOpt::Level OL);
Reid Kleckner357600e2014-11-20 23:37:18 +000037 ~SystemZTargetMachine() override;
Ulrich Weigand5f613df2013-05-06 16:15:19 +000038
Eric Christopher4d0f35a2015-03-21 04:22:23 +000039 const SystemZSubtarget *getSubtargetImpl() const { return &Subtarget; }
Eugene Zelenko3943d2b2017-01-24 22:10:43 +000040
Eric Christopher4d0f35a2015-03-21 04:22:23 +000041 const SystemZSubtarget *getSubtargetImpl(const Function &) const override {
Ulrich Weigand5f613df2013-05-06 16:15:19 +000042 return &Subtarget;
43 }
Eugene Zelenko3943d2b2017-01-24 22:10:43 +000044
Ulrich Weigand5f613df2013-05-06 16:15:19 +000045 // Override LLVMTargetMachine
Richard Sandifordb4d67b52014-03-06 12:03:36 +000046 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
Ulrich Weigand1f6666a2015-03-31 12:52:27 +000047 TargetIRAnalysis getTargetIRAnalysis() override;
Eugene Zelenko3943d2b2017-01-24 22:10:43 +000048
Aditya Nandakumara2719322014-11-13 09:26:31 +000049 TargetLoweringObjectFile *getObjFileLowering() const override {
50 return TLOF.get();
51 }
Jonas Paulssone451eef2015-12-10 09:10:07 +000052
53 bool targetSchedulesPostRAScheduling() const override { return true; };
Ulrich Weigand5f613df2013-05-06 16:15:19 +000054};
55
56} // end namespace llvm
57
Eugene Zelenko3943d2b2017-01-24 22:10:43 +000058#endif // LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETMACHINE_H