Eugene Zelenko | 3943d2b | 2017-01-24 22:10:43 +0000 | [diff] [blame] | 1 | //=- SystemZTargetMachine.h - Define TargetMachine for SystemZ ----*- C++ -*-=// |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file declares the SystemZ specific subclass of TargetMachine. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 14 | #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETMACHINE_H |
| 15 | #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETMACHINE_H |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 16 | |
Chandler Carruth | 8a8cd2b | 2014-01-07 11:48:04 +0000 | [diff] [blame] | 17 | #include "SystemZSubtarget.h" |
Eugene Zelenko | 3943d2b | 2017-01-24 22:10:43 +0000 | [diff] [blame] | 18 | #include "llvm/ADT/Optional.h" |
| 19 | #include "llvm/ADT/StringRef.h" |
| 20 | #include "llvm/Analysis/TargetTransformInfo.h" |
| 21 | #include "llvm/Support/CodeGen.h" |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 22 | #include "llvm/Target/TargetMachine.h" |
Eugene Zelenko | 3943d2b | 2017-01-24 22:10:43 +0000 | [diff] [blame] | 23 | #include <memory> |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 24 | |
| 25 | namespace llvm { |
| 26 | |
Matthias Braun | bb8507e | 2017-10-12 22:57:28 +0000 | [diff] [blame] | 27 | class SystemZTargetMachine : public LLVMTargetMachine { |
Aditya Nandakumar | a271932 | 2014-11-13 09:26:31 +0000 | [diff] [blame] | 28 | std::unique_ptr<TargetLoweringObjectFile> TLOF; |
Eugene Zelenko | 3943d2b | 2017-01-24 22:10:43 +0000 | [diff] [blame] | 29 | SystemZSubtarget Subtarget; |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 30 | |
| 31 | public: |
Daniel Sanders | 3e5de88 | 2015-06-11 19:41:26 +0000 | [diff] [blame] | 32 | SystemZTargetMachine(const Target &T, const Triple &TT, StringRef CPU, |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 33 | StringRef FS, const TargetOptions &Options, |
Rafael Espindola | 79e238a | 2017-08-03 02:16:21 +0000 | [diff] [blame] | 34 | Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM, |
| 35 | CodeGenOpt::Level OL, bool JIT); |
Reid Kleckner | 357600e | 2014-11-20 23:37:18 +0000 | [diff] [blame] | 36 | ~SystemZTargetMachine() override; |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 37 | |
Eric Christopher | 4d0f35a | 2015-03-21 04:22:23 +0000 | [diff] [blame] | 38 | const SystemZSubtarget *getSubtargetImpl() const { return &Subtarget; } |
Eugene Zelenko | 3943d2b | 2017-01-24 22:10:43 +0000 | [diff] [blame] | 39 | |
Eric Christopher | 4d0f35a | 2015-03-21 04:22:23 +0000 | [diff] [blame] | 40 | const SystemZSubtarget *getSubtargetImpl(const Function &) const override { |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 41 | return &Subtarget; |
| 42 | } |
Eugene Zelenko | 3943d2b | 2017-01-24 22:10:43 +0000 | [diff] [blame] | 43 | |
Matthias Braun | bb8507e | 2017-10-12 22:57:28 +0000 | [diff] [blame] | 44 | // Override LLVMTargetMachine |
Richard Sandiford | b4d67b5 | 2014-03-06 12:03:36 +0000 | [diff] [blame] | 45 | TargetPassConfig *createPassConfig(PassManagerBase &PM) override; |
Sanjoy Das | 26d11ca | 2017-12-22 18:21:59 +0000 | [diff] [blame] | 46 | TargetTransformInfo getTargetTransformInfo(const Function &F) override; |
Eugene Zelenko | 3943d2b | 2017-01-24 22:10:43 +0000 | [diff] [blame] | 47 | |
Aditya Nandakumar | a271932 | 2014-11-13 09:26:31 +0000 | [diff] [blame] | 48 | TargetLoweringObjectFile *getObjFileLowering() const override { |
| 49 | return TLOF.get(); |
| 50 | } |
Jonas Paulsson | e451eef | 2015-12-10 09:10:07 +0000 | [diff] [blame] | 51 | |
| 52 | bool targetSchedulesPostRAScheduling() const override { return true; }; |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | } // end namespace llvm |
| 56 | |
Eugene Zelenko | 3943d2b | 2017-01-24 22:10:43 +0000 | [diff] [blame] | 57 | #endif // LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETMACHINE_H |