/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h
Line | Count | Source |
1 | | //===-- SystemZRegisterInfo.h - SystemZ register information ----*- 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 | | #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZREGISTERINFO_H |
11 | | #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZREGISTERINFO_H |
12 | | |
13 | | #include "SystemZ.h" |
14 | | #include "llvm/Target/TargetRegisterInfo.h" |
15 | | |
16 | | #define GET_REGINFO_HEADER |
17 | | #include "SystemZGenRegisterInfo.inc" |
18 | | |
19 | | namespace llvm { |
20 | | |
21 | | namespace SystemZ { |
22 | | // Return the subreg to use for referring to the even and odd registers |
23 | | // in a GR128 pair. Is32Bit says whether we want a GR32 or GR64. |
24 | 215 | inline unsigned even128(bool Is32bit) { |
25 | 215 | return Is32bit ? subreg_hl3284 : subreg_h64131 ; |
26 | 215 | } |
27 | 215 | inline unsigned odd128(bool Is32bit) { |
28 | 215 | return Is32bit ? subreg_l3284 : subreg_l64131 ; |
29 | 215 | } |
30 | | } // end namespace SystemZ |
31 | | |
32 | | struct SystemZRegisterInfo : public SystemZGenRegisterInfo { |
33 | | public: |
34 | | SystemZRegisterInfo(); |
35 | | |
36 | | /// getPointerRegClass - Return the register class to use to hold pointers. |
37 | | /// This is currently only used by LOAD_STACK_GUARD, which requires a non-%r0 |
38 | | /// register, hence ADDR64. |
39 | | const TargetRegisterClass * |
40 | | getPointerRegClass(const MachineFunction &MF, |
41 | 25 | unsigned Kind=0) const override { |
42 | 25 | return &SystemZ::ADDR64BitRegClass; |
43 | 25 | } |
44 | | |
45 | | // Override TargetRegisterInfo.h. |
46 | 13.1k | bool requiresRegisterScavenging(const MachineFunction &MF) const override { |
47 | 13.1k | return true; |
48 | 13.1k | } |
49 | 6.58k | bool requiresFrameIndexScavenging(const MachineFunction &MF) const override { |
50 | 6.58k | return true; |
51 | 6.58k | } |
52 | 13.9k | bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override { |
53 | 13.9k | return true; |
54 | 13.9k | } |
55 | | const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override; |
56 | | const uint32_t *getCallPreservedMask(const MachineFunction &MF, |
57 | | CallingConv::ID CC) const override; |
58 | | BitVector getReservedRegs(const MachineFunction &MF) const override; |
59 | | void eliminateFrameIndex(MachineBasicBlock::iterator MI, |
60 | | int SPAdj, unsigned FIOperandNum, |
61 | | RegScavenger *RS) const override; |
62 | | unsigned getFrameRegister(const MachineFunction &MF) const override; |
63 | | }; |
64 | | |
65 | | } // end namespace llvm |
66 | | |
67 | | #endif |