blob: a658c9258f0ef9534f2483196d2fb8c3efda13d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
//===- PTXRegisterInfo.h - PTX Register Information Impl --------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the PTX implementation of the MRegisterInfo class.
//
//===----------------------------------------------------------------------===//
#ifndef PTX_REGISTER_INFO_H
#define PTX_REGISTER_INFO_H
#include "llvm/Support/ErrorHandling.h"
#include "llvm/ADT/BitVector.h"
#include "PTXGenRegisterInfo.h.inc"
namespace llvm {
class PTXTargetMachine;
class MachineFunction;
struct PTXRegisterInfo : public PTXGenRegisterInfo {
PTXRegisterInfo(PTXTargetMachine &TM,
const TargetInstrInfo &TII) {}
virtual const unsigned
*getCalleeSavedRegs(const MachineFunction *MF = 0) const {
static const unsigned CalleeSavedRegs[] = { 0 };
return CalleeSavedRegs; // save nothing
}
virtual BitVector getReservedRegs(const MachineFunction &MF) const {
BitVector Reserved(getNumRegs());
return Reserved; // reserve no regs
}
virtual bool hasFP(const MachineFunction &MF) const { return false; }
virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI,
int SPAdj,
RegScavenger *RS = NULL) const {
llvm_unreachable("PTX does not support general function call");
}
virtual void emitPrologue(MachineFunction &MF) const {}
virtual void emitEpilogue(MachineFunction &MF,
MachineBasicBlock &MBB) const {}
virtual unsigned getFrameRegister(const MachineFunction &MF) const {
llvm_unreachable("PTX does not have a frame register");
return 0;
}
virtual unsigned getRARegister() const {
llvm_unreachable("PTX does not have a return address register");
return 0;
}
virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const {
return PTXGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
}
}; // struct PTXRegisterInfo
} // namespace llvm
#endif // PTX_REGISTER_INFO_H
|