Use BranchProbability instead of floating points in IfConverter.
[llvm/stm8.git] / lib / Target / PTX / PTXTargetMachine.h
blobae421532521113f6e71d530d05cfbb8cd7c14d68
1 //===-- PTXTargetMachine.h - Define TargetMachine for PTX -------*- 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 PTX specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef PTX_TARGET_MACHINE_H
15 #define PTX_TARGET_MACHINE_H
17 #include "PTXISelLowering.h"
18 #include "PTXInstrInfo.h"
19 #include "PTXFrameLowering.h"
20 #include "PTXSubtarget.h"
21 #include "llvm/Target/TargetData.h"
22 #include "llvm/Target/TargetFrameLowering.h"
23 #include "llvm/Target/TargetMachine.h"
25 namespace llvm {
26 class PTXTargetMachine : public LLVMTargetMachine {
27 private:
28 const TargetData DataLayout;
29 PTXSubtarget Subtarget; // has to be initialized before FrameLowering
30 PTXFrameLowering FrameLowering;
31 PTXInstrInfo InstrInfo;
32 PTXTargetLowering TLInfo;
34 public:
35 PTXTargetMachine(const Target &T, const std::string &TT,
36 const std::string &CPU, const std::string &FS,
37 bool is64Bit);
39 virtual const TargetData *getTargetData() const { return &DataLayout; }
41 virtual const TargetFrameLowering *getFrameLowering() const {
42 return &FrameLowering;
45 virtual const PTXInstrInfo *getInstrInfo() const { return &InstrInfo; }
46 virtual const TargetRegisterInfo *getRegisterInfo() const {
47 return &InstrInfo.getRegisterInfo(); }
49 virtual const PTXTargetLowering *getTargetLowering() const {
50 return &TLInfo; }
52 virtual const PTXSubtarget *getSubtargetImpl() const { return &Subtarget; }
54 virtual bool addInstSelector(PassManagerBase &PM,
55 CodeGenOpt::Level OptLevel);
56 virtual bool addPostRegAlloc(PassManagerBase &PM,
57 CodeGenOpt::Level OptLevel);
58 }; // class PTXTargetMachine
61 class PTX32TargetMachine : public PTXTargetMachine {
62 public:
64 PTX32TargetMachine(const Target &T, const std::string &TT,
65 const std::string& CPU, const std::string& FS);
66 }; // class PTX32TargetMachine
68 class PTX64TargetMachine : public PTXTargetMachine {
69 public:
71 PTX64TargetMachine(const Target &T, const std::string &TT,
72 const std::string& CPU, const std::string& FS);
73 }; // class PTX32TargetMachine
75 } // namespace llvm
77 #endif // PTX_TARGET_MACHINE_H