blob: ac04a080f5808bb7142668d0ca3edb57b7507759 [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//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Ulrich Weigand5f613df2013-05-06 16:15:19 +00006//
7//===----------------------------------------------------------------------===//
8//
9// This file declares the SystemZ specific subclass of TargetMachine.
10//
11//===----------------------------------------------------------------------===//
12
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETMACHINE_H
15#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETMACHINE_H
Ulrich Weigand5f613df2013-05-06 16:15:19 +000016
Chandler Carruth8a8cd2b2014-01-07 11:48:04 +000017#include "SystemZSubtarget.h"
Eugene Zelenko3943d2b2017-01-24 22:10:43 +000018#include "llvm/ADT/Optional.h"
19#include "llvm/ADT/StringRef.h"
20#include "llvm/Analysis/TargetTransformInfo.h"
21#include "llvm/Support/CodeGen.h"
Ulrich Weigand5f613df2013-05-06 16:15:19 +000022#include "llvm/Target/TargetMachine.h"
Eugene Zelenko3943d2b2017-01-24 22:10:43 +000023#include <memory>
Ulrich Weigand5f613df2013-05-06 16:15:19 +000024
25namespace llvm {
26
Matthias Braunbb8507e2017-10-12 22:57:28 +000027class SystemZTargetMachine : public LLVMTargetMachine {
Aditya Nandakumara2719322014-11-13 09:26:31 +000028 std::unique_ptr<TargetLoweringObjectFile> TLOF;
Eugene Zelenko3943d2b2017-01-24 22:10:43 +000029 SystemZSubtarget Subtarget;
Ulrich Weigand5f613df2013-05-06 16:15:19 +000030
31public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000032 SystemZTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
Ulrich Weigand5f613df2013-05-06 16:15:19 +000033 StringRef FS, const TargetOptions &Options,
Rafael Espindola79e238a2017-08-03 02:16:21 +000034 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
35 CodeGenOpt::Level OL, bool JIT);
Reid Kleckner357600e2014-11-20 23:37:18 +000036 ~SystemZTargetMachine() override;
Ulrich Weigand5f613df2013-05-06 16:15:19 +000037
Eric Christopher4d0f35a2015-03-21 04:22:23 +000038 const SystemZSubtarget *getSubtargetImpl() const { return &Subtarget; }
Eugene Zelenko3943d2b2017-01-24 22:10:43 +000039
Eric Christopher4d0f35a2015-03-21 04:22:23 +000040 const SystemZSubtarget *getSubtargetImpl(const Function &) const override {
Ulrich Weigand5f613df2013-05-06 16:15:19 +000041 return &Subtarget;
42 }
Eugene Zelenko3943d2b2017-01-24 22:10:43 +000043
Matthias Braunbb8507e2017-10-12 22:57:28 +000044 // Override LLVMTargetMachine
Richard Sandifordb4d67b52014-03-06 12:03:36 +000045 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
Sanjoy Das26d11ca2017-12-22 18:21:59 +000046 TargetTransformInfo getTargetTransformInfo(const Function &F) override;
Eugene Zelenko3943d2b2017-01-24 22:10:43 +000047
Aditya Nandakumara2719322014-11-13 09:26:31 +000048 TargetLoweringObjectFile *getObjFileLowering() const override {
49 return TLOF.get();
50 }
Jonas Paulssone451eef2015-12-10 09:10:07 +000051
52 bool targetSchedulesPostRAScheduling() const override { return true; };
Ulrich Weigand5f613df2013-05-06 16:15:19 +000053};
54
55} // end namespace llvm
56
Eugene Zelenko3943d2b2017-01-24 22:10:43 +000057#endif // LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETMACHINE_H