blob: 42d7dc573284d5bc868c2d4ce839df9393c01e54 [file] [log] [blame]
Tim Northover3b0846e2014-05-24 12:50:23 +00001//==-- AArch64TargetMachine.h - Define TargetMachine for AArch64 -*- 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 AArch64 specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64TARGETMACHINE_H
15#define LLVM_LIB_TARGET_AARCH64_AARCH64TARGETMACHINE_H
Tim Northover3b0846e2014-05-24 12:50:23 +000016
17#include "AArch64InstrInfo.h"
Tim Northover3b0846e2014-05-24 12:50:23 +000018#include "AArch64Subtarget.h"
Tim Northover3b0846e2014-05-24 12:50:23 +000019#include "llvm/IR/DataLayout.h"
20#include "llvm/Target/TargetMachine.h"
Tim Northover3b0846e2014-05-24 12:50:23 +000021
22namespace llvm {
23
24class AArch64TargetMachine : public LLVMTargetMachine {
25protected:
26 AArch64Subtarget Subtarget;
27
Tim Northover3b0846e2014-05-24 12:50:23 +000028public:
29 AArch64TargetMachine(const Target &T, StringRef TT, StringRef CPU,
30 StringRef FS, const TargetOptions &Options,
31 Reloc::Model RM, CodeModel::Model CM,
32 CodeGenOpt::Level OL, bool IsLittleEndian);
33
34 const AArch64Subtarget *getSubtargetImpl() const override {
35 return &Subtarget;
36 }
Tim Northover3b0846e2014-05-24 12:50:23 +000037
38 // Pass Pipeline Configuration
39 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
40
41 /// \brief Register AArch64 analysis passes with a pass manager.
42 void addAnalysisPasses(PassManagerBase &PM) override;
Arnaud A. de Grandmaisonc75dbbb2014-09-10 14:06:10 +000043
44 /// \brief Query if the PBQP register allocator is being used
45 bool isPBQPUsed() const { return usingPBQP; }
46
47private:
48 bool usingPBQP;
Tim Northover3b0846e2014-05-24 12:50:23 +000049};
50
51// AArch64leTargetMachine - AArch64 little endian target machine.
52//
53class AArch64leTargetMachine : public AArch64TargetMachine {
54 virtual void anchor();
55public:
56 AArch64leTargetMachine(const Target &T, StringRef TT, StringRef CPU,
57 StringRef FS, const TargetOptions &Options,
58 Reloc::Model RM, CodeModel::Model CM,
59 CodeGenOpt::Level OL);
60};
61
62// AArch64beTargetMachine - AArch64 big endian target machine.
63//
64class AArch64beTargetMachine : public AArch64TargetMachine {
65 virtual void anchor();
66public:
67 AArch64beTargetMachine(const Target &T, StringRef TT, StringRef CPU,
68 StringRef FS, const TargetOptions &Options,
69 Reloc::Model RM, CodeModel::Model CM,
70 CodeGenOpt::Level OL);
71};
72
73} // end namespace llvm
74
75#endif