[PBQP] Teach PassConfig to tell if the default register allocator is used.
[oota-llvm.git] / lib / Target / AArch64 / AArch64TargetMachine.h
1 //==-- 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
14 #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64TARGETMACHINE_H
15 #define LLVM_LIB_TARGET_AARCH64_AARCH64TARGETMACHINE_H
16
17 #include "AArch64InstrInfo.h"
18 #include "AArch64Subtarget.h"
19 #include "llvm/IR/DataLayout.h"
20 #include "llvm/Target/TargetMachine.h"
21
22 namespace llvm {
23
24 class AArch64TargetMachine : public LLVMTargetMachine {
25 protected:
26   AArch64Subtarget Subtarget;
27   mutable StringMap<std::unique_ptr<AArch64Subtarget>> SubtargetMap;
28
29 public:
30   AArch64TargetMachine(const Target &T, StringRef TT, StringRef CPU,
31                        StringRef FS, const TargetOptions &Options,
32                        Reloc::Model RM, CodeModel::Model CM,
33                        CodeGenOpt::Level OL, bool IsLittleEndian);
34
35   const AArch64Subtarget *getSubtargetImpl() const override {
36     return &Subtarget;
37   }
38   const AArch64Subtarget *getSubtargetImpl(const Function &F) const override;
39
40   // Pass Pipeline Configuration
41   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
42
43   /// \brief Register AArch64 analysis passes with a pass manager.
44   void addAnalysisPasses(PassManagerBase &PM) override;
45
46 private:
47   bool isLittle;
48 };
49
50 // AArch64leTargetMachine - AArch64 little endian target machine.
51 //
52 class AArch64leTargetMachine : public AArch64TargetMachine {
53   virtual void anchor();
54 public:
55   AArch64leTargetMachine(const Target &T, StringRef TT, StringRef CPU,
56                          StringRef FS, const TargetOptions &Options,
57                          Reloc::Model RM, CodeModel::Model CM,
58                          CodeGenOpt::Level OL);
59 };
60
61 // AArch64beTargetMachine - AArch64 big endian target machine.
62 //
63 class AArch64beTargetMachine : public AArch64TargetMachine {
64   virtual void anchor();
65 public:
66   AArch64beTargetMachine(const Target &T, StringRef TT, StringRef CPU,
67                          StringRef FS, const TargetOptions &Options,
68                          Reloc::Model RM, CodeModel::Model CM,
69                          CodeGenOpt::Level OL);
70 };
71
72 } // end namespace llvm
73
74 #endif