LLVM 24.0.0git
HexagonRegisterInfo.h
Go to the documentation of this file.
1//==- HexagonRegisterInfo.h - Hexagon Register Information Impl --*- C++ -*-==//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file contains the Hexagon implementation of the TargetRegisterInfo
10// class.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONREGISTERINFO_H
15#define LLVM_LIB_TARGET_HEXAGON_HEXAGONREGISTERINFO_H
16
18
19#define GET_REGINFO_HEADER
20#include "HexagonGenRegisterInfo.inc"
21
22namespace llvm {
23
24namespace Hexagon {
25 // Generic (pseudo) subreg indices for use with getHexagonSubRegIndex.
26 enum { ps_sub_lo = 0, ps_sub_hi = 1 };
27}
28
30public:
31 HexagonRegisterInfo(unsigned HwMode);
32
33 /// Code Generation virtual methods...
35 const override;
37 CallingConv::ID) const override;
38
39 BitVector getReservedRegs(const MachineFunction &MF) const override;
40
41 /// Compute the first available callee-saved register to use as the
42 /// aligned-stack base register when this function needs dynamic stack
43 /// realignment. This does not update the machine function info.
45
47 unsigned FIOperandNum, RegScavenger *RS = nullptr) const override;
48
49 /// Returns true since we may need scavenging for a temporary register
50 /// when generating hardware loop instructions.
51 bool requiresRegisterScavenging(const MachineFunction &MF) const override {
52 return true;
53 }
54
55 /// Returns true. Spill code for predicate registers might need an extra
56 /// register.
57 bool requiresFrameIndexScavenging(const MachineFunction &MF) const override {
58 return true;
59 }
60
61 /// Returns true if the frame pointer is valid.
62 bool useFPForScavengingIndex(const MachineFunction &MF) const override;
63
65 unsigned SubReg, const TargetRegisterClass *DstRC, unsigned DstSubReg,
66 const TargetRegisterClass *NewRC, LiveIntervals &LIS) const override;
67
68 // Debug information queries.
69 Register getFrameRegister(const MachineFunction &MF) const override;
72
74 unsigned GenIdx) const;
75
77 const TargetRegisterClass *RC) const;
78
80 getPointerRegClass(unsigned Kind = 0) const override;
81
82 /// Returns true if the given reserved physical register is live across
83 /// function calls/returns.
84 bool isGlobalReg(MCPhysReg Reg) const;
85
86 /// Returns true if the given reserved physical register Reg is live
87 /// across function calls/returns. This function should not be used for
88 /// non-reserved registers, instead register liveness information should be
89 /// checked
90 bool isFakeReg(MCPhysReg Reg) const;
91
93
94private:
95 BitVector getBaseReservedRegs(const MachineFunction &MF) const;
98 const BitVector &BaseReservedRegs) const;
99};
100
101} // end namespace llvm
102
103#endif
IRTranslator LLVM IR MI
Register Reg
uint64_t IntrinsicInst * II
bool eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
bool isEHReturnCalleeSaveReg(Register Reg) const
BitVector getReservedRegs(const MachineFunction &MF) const override
Register computeStackAlignBaseRegister(const MachineFunction &MF) const
Compute the first available callee-saved register to use as the aligned-stack base register when this...
const TargetRegisterClass * getPointerRegClass(unsigned Kind=0) const override
bool useFPForScavengingIndex(const MachineFunction &MF) const override
Returns true if the frame pointer is valid.
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
Code Generation virtual methods...
bool requiresFrameIndexScavenging(const MachineFunction &MF) const override
Returns true.
unsigned getHexagonSubRegIndex(const TargetRegisterClass &RC, unsigned GenIdx) const
bool shouldCoalesce(MachineInstr *MI, const TargetRegisterClass *SrcRC, unsigned SubReg, const TargetRegisterClass *DstRC, unsigned DstSubReg, const TargetRegisterClass *NewRC, LiveIntervals &LIS) const override
bool requiresRegisterScavenging(const MachineFunction &MF) const override
Returns true since we may need scavenging for a temporary register when generating hardware loop inst...
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override
bool isFakeReg(MCPhysReg Reg) const
Returns true if the given reserved physical register Reg is live across function calls/returns.
const MCPhysReg * getCallerSavedRegs(const MachineFunction *MF, const TargetRegisterClass *RC) const
bool isGlobalReg(MCPhysReg Reg) const
Returns true if the given reserved physical register is live across function calls/returns.
MachineInstrBundleIterator< MachineInstr > iterator
Representation of each machine instruction.
Wrapper class representing virtual and physical registers.
Definition Register.h:20
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24
This is an optimization pass for GlobalISel generic memory operations.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
Definition MCRegister.h:21
MCRegisterClass TargetRegisterClass
Definition FastISel.h:58