| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 1 | //=-- HexagonTargetMachine.h - Define TargetMachine for Hexagon ---*- 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 Hexagon specific subclass of TargetMachine. | 
|  | 11 | // | 
|  | 12 | //===----------------------------------------------------------------------===// | 
|  | 13 |  | 
| Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 14 | #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETMACHINE_H | 
|  | 15 | #define LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETMACHINE_H | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 16 |  | 
| Chandler Carruth | 802d755 | 2012-12-04 07:12:27 +0000 | [diff] [blame] | 17 | #include "HexagonInstrInfo.h" | 
| Chandler Carruth | 802d755 | 2012-12-04 07:12:27 +0000 | [diff] [blame] | 18 | #include "HexagonSubtarget.h" | 
| Krzysztof Parzyszek | 21dc8bd | 2015-12-18 20:19:30 +0000 | [diff] [blame] | 19 | #include "HexagonTargetObjectFile.h" | 
| Chandler Carruth | 802d755 | 2012-12-04 07:12:27 +0000 | [diff] [blame] | 20 | #include "llvm/Target/TargetMachine.h" | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 21 |  | 
|  | 22 | namespace llvm { | 
|  | 23 |  | 
|  | 24 | class Module; | 
|  | 25 |  | 
| Matthias Braun | bb8507e | 2017-10-12 22:57:28 +0000 | [diff] [blame] | 26 | class HexagonTargetMachine : public LLVMTargetMachine { | 
| Aditya Nandakumar | a271932 | 2014-11-13 09:26:31 +0000 | [diff] [blame] | 27 | std::unique_ptr<TargetLoweringObjectFile> TLOF; | 
| Krzysztof Parzyszek | 73e66f3 | 2015-08-05 18:35:37 +0000 | [diff] [blame] | 28 | mutable StringMap<std::unique_ptr<HexagonSubtarget>> SubtargetMap; | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 29 |  | 
|  | 30 | public: | 
| Daniel Sanders | 3e5de88 | 2015-06-11 19:41:26 +0000 | [diff] [blame] | 31 | HexagonTargetMachine(const Target &T, const Triple &TT, StringRef CPU, | 
| Craig Topper | b545408 | 2012-03-17 09:24:09 +0000 | [diff] [blame] | 32 | StringRef FS, const TargetOptions &Options, | 
| Rafael Espindola | 79e238a | 2017-08-03 02:16:21 +0000 | [diff] [blame] | 33 | Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM, | 
|  | 34 | CodeGenOpt::Level OL, bool JIT); | 
| Reid Kleckner | 357600e | 2014-11-20 23:37:18 +0000 | [diff] [blame] | 35 | ~HexagonTargetMachine() override; | 
| Krzysztof Parzyszek | 73e66f3 | 2015-08-05 18:35:37 +0000 | [diff] [blame] | 36 | const HexagonSubtarget *getSubtargetImpl(const Function &F) const override; | 
|  | 37 |  | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 38 | static unsigned getModuleMatchQuality(const Module &M); | 
|  | 39 |  | 
| Krzysztof Parzyszek | c8b9438 | 2017-01-26 21:41:10 +0000 | [diff] [blame] | 40 | void adjustPassManager(PassManagerBuilder &PMB) override; | 
| Craig Topper | 906c2cd | 2014-04-29 07:58:16 +0000 | [diff] [blame] | 41 | TargetPassConfig *createPassConfig(PassManagerBase &PM) override; | 
| Sanjoy Das | 26d11ca | 2017-12-22 18:21:59 +0000 | [diff] [blame] | 42 | TargetTransformInfo getTargetTransformInfo(const Function &F) override; | 
| Aditya Nandakumar | a271932 | 2014-11-13 09:26:31 +0000 | [diff] [blame] | 43 |  | 
| Krzysztof Parzyszek | 21dc8bd | 2015-12-18 20:19:30 +0000 | [diff] [blame] | 44 | HexagonTargetObjectFile *getObjFileLowering() const override { | 
|  | 45 | return static_cast<HexagonTargetObjectFile*>(TLOF.get()); | 
| Aditya Nandakumar | a271932 | 2014-11-13 09:26:31 +0000 | [diff] [blame] | 46 | } | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 47 | }; | 
|  | 48 |  | 
| Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 49 | } // end namespace llvm | 
|  | 50 |  | 
|  | 51 | #endif |