[llvm] [Mips] Reserve hardware register HWR2 (PR #127775)

via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 19 20:24:27 PST 2025


https://github.com/yingopq updated https://github.com/llvm/llvm-project/pull/127775

>From 9e210ca145ec2bd0bb0fd84d0aaca7c6d4839870 Mon Sep 17 00:00:00 2001
From: Ying Huang <ying.huang at oss.cipunited.com>
Date: Wed, 19 Feb 2025 04:59:10 -0500
Subject: [PATCH] [Mips] Reserve hardware register HWR2.

Fix pr #127553.
x86_64 failed to run readcyclecounter.ll when enable expensive_check,
it would error "Using an undefined physical register".
---
 llvm/lib/Target/Mips/MipsRegisterInfo.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/lib/Target/Mips/MipsRegisterInfo.cpp b/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
index c9eff0e0285f4..4d42d56a987c4 100644
--- a/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
+++ b/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
@@ -205,6 +205,7 @@ getReservedRegs(const MachineFunction &MF) const {
 
   // Reserve hardware registers.
   Reserved.set(Mips::HWR29);
+  Reserved.set(Mips::HWR2);
 
   // Reserve DSP control register.
   Reserved.set(Mips::DSPPos);



More information about the llvm-commits mailing list