The ZERO register should be exposed as a constant physical register through the interface TargetRegisterInfo::isConstantPhysReg.
Differential Revision: https://reviews.llvm.org/D130932
// sized objects.
return MF.getRegInfo().canReserveReg(BP);
}
+
+bool MipsRegisterInfo::isConstantPhysReg(MCRegister PhysReg) const {
+ return PhysReg == Mips::ZERO_64 || PhysReg == Mips::ZERO;
+}
/// 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;