forked from OSchip/llvm-project
[MIPS] Expose the ZERO register as a constant physical register
The ZERO register should be exposed as a constant physical register through the interface TargetRegisterInfo::isConstantPhysReg. Differential Revision: https://reviews.llvm.org/D130932
This commit is contained in:
parent
da38bcfd52
commit
85a6dd50ad
|
@ -318,3 +318,7 @@ bool MipsRegisterInfo::canRealignStack(const MachineFunction &MF) const {
|
|||
// sized objects.
|
||||
return MF.getRegInfo().canReserveReg(BP);
|
||||
}
|
||||
|
||||
bool MipsRegisterInfo::isConstantPhysReg(MCRegister PhysReg) const {
|
||||
return PhysReg == Mips::ZERO_64 || PhysReg == Mips::ZERO;
|
||||
}
|
||||
|
|
|
@ -69,6 +69,8 @@ public:
|
|||
/// Debug information queries.
|
||||
Register getFrameRegister(const MachineFunction &MF) const override;
|
||||
|
||||
bool isConstantPhysReg(MCRegister PhysReg) const override;
|
||||
|
||||
/// Return GPR register class.
|
||||
virtual const TargetRegisterClass *intRegClass(unsigned Size) const = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue