Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 1 | //==- SystemZTargetMachine.h - Define TargetMachine for SystemZ ---*- C++ -*-=// |
| 2 | // |
| 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 | |
| 15 | #ifndef SYSTEMZTARGETMACHINE_H |
| 16 | #define SYSTEMZTARGETMACHINE_H |
| 17 | |
| 18 | #include "SystemZFrameLowering.h" |
| 19 | #include "SystemZISelLowering.h" |
| 20 | #include "SystemZInstrInfo.h" |
| 21 | #include "SystemZRegisterInfo.h" |
Richard Sandiford | d131ff8 | 2013-07-08 09:35:23 +0000 | [diff] [blame] | 22 | #include "SystemZSelectionDAGInfo.h" |
Chandler Carruth | 8a8cd2b | 2014-01-07 11:48:04 +0000 | [diff] [blame] | 23 | #include "SystemZSubtarget.h" |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 24 | #include "llvm/IR/DataLayout.h" |
| 25 | #include "llvm/Target/TargetFrameLowering.h" |
| 26 | #include "llvm/Target/TargetMachine.h" |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 27 | |
| 28 | namespace llvm { |
| 29 | |
| 30 | class SystemZTargetMachine : public LLVMTargetMachine { |
| 31 | SystemZSubtarget Subtarget; |
| 32 | const DataLayout DL; |
| 33 | SystemZInstrInfo InstrInfo; |
| 34 | SystemZTargetLowering TLInfo; |
Richard Sandiford | d131ff8 | 2013-07-08 09:35:23 +0000 | [diff] [blame] | 35 | SystemZSelectionDAGInfo TSInfo; |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 36 | SystemZFrameLowering FrameLowering; |
| 37 | |
| 38 | public: |
| 39 | SystemZTargetMachine(const Target &T, StringRef TT, StringRef CPU, |
| 40 | StringRef FS, const TargetOptions &Options, |
| 41 | Reloc::Model RM, CodeModel::Model CM, |
| 42 | CodeGenOpt::Level OL); |
| 43 | |
| 44 | // Override TargetMachine. |
Richard Sandiford | b4d67b5 | 2014-03-06 12:03:36 +0000 | [diff] [blame] | 45 | const TargetFrameLowering *getFrameLowering() const override { |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 46 | return &FrameLowering; |
| 47 | } |
Richard Sandiford | b4d67b5 | 2014-03-06 12:03:36 +0000 | [diff] [blame] | 48 | const SystemZInstrInfo *getInstrInfo() const override { |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 49 | return &InstrInfo; |
| 50 | } |
Richard Sandiford | b4d67b5 | 2014-03-06 12:03:36 +0000 | [diff] [blame] | 51 | const SystemZSubtarget *getSubtargetImpl() const override { |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 52 | return &Subtarget; |
| 53 | } |
Richard Sandiford | b4d67b5 | 2014-03-06 12:03:36 +0000 | [diff] [blame] | 54 | const DataLayout *getDataLayout() const override { |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 55 | return &DL; |
| 56 | } |
Richard Sandiford | b4d67b5 | 2014-03-06 12:03:36 +0000 | [diff] [blame] | 57 | const SystemZRegisterInfo *getRegisterInfo() const override { |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 58 | return &InstrInfo.getRegisterInfo(); |
| 59 | } |
Richard Sandiford | b4d67b5 | 2014-03-06 12:03:36 +0000 | [diff] [blame] | 60 | const SystemZTargetLowering *getTargetLowering() const override { |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 61 | return &TLInfo; |
| 62 | } |
Richard Sandiford | b4d67b5 | 2014-03-06 12:03:36 +0000 | [diff] [blame] | 63 | const TargetSelectionDAGInfo *getSelectionDAGInfo() const override { |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 64 | return &TSInfo; |
| 65 | } |
| 66 | |
| 67 | // Override LLVMTargetMachine |
Richard Sandiford | b4d67b5 | 2014-03-06 12:03:36 +0000 | [diff] [blame] | 68 | TargetPassConfig *createPassConfig(PassManagerBase &PM) override; |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 69 | }; |
| 70 | |
| 71 | } // end namespace llvm |
| 72 | |
| 73 | #endif |