LLVM 20.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
42 unsigned FIOperandNum, RegScavenger *RS = nullptr) const override;
43
44 /// Returns true since we may need scavenging for a temporary register
45 /// when generating hardware loop instructions.
46 bool requiresRegisterScavenging(const MachineFunction &MF) const override {
47 return true;
48 }
49
50 /// Returns true. Spill code for predicate registers might need an extra
51 /// register.
52 bool requiresFrameIndexScavenging(const MachineFunction &MF) const override {
53 return true;
54 }
55
56 /// Returns true if the frame pointer is valid.
57 bool useFPForScavengingIndex(const MachineFunction &MF) const override;
58
60 unsigned SubReg, const TargetRegisterClass *DstRC, unsigned DstSubReg,
61 const TargetRegisterClass *NewRC, LiveIntervals &LIS) const override;
62
63 // Debug information queries.
64 Register getFrameRegister(const MachineFunction &MF) const override;
67
69 unsigned GenIdx) const;
70
72 const TargetRegisterClass *RC) const;
73
76 unsigned Kind = 0) const override;
77
79};
80
81} // end namespace llvm
82
83#endif
unsigned SubReg
IRTranslator LLVM IR MI
unsigned Reg
uint64_t IntrinsicInst * II
bool eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
bool isEHReturnCalleeSaveReg(Register Reg) const
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind=0) const override
BitVector getReservedRegs(const MachineFunction &MF) 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
const MCPhysReg * getCallerSavedRegs(const MachineFunction *MF, const TargetRegisterClass *RC) const
Representation of each machine instruction.
Definition: MachineInstr.h:69
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18