Skip to content

Commit 0c809ea

Browse files
authored
[Mips] Reserve hardware register HWR2 (#127775)
Fix pr #127553. x86_64 failed to run readcyclecounter.ll when enable expensive_check, it would error "Using an undefined physical register".
1 parent 0a8341f commit 0c809ea

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

llvm/lib/Target/Mips/MipsRegisterInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ getReservedRegs(const MachineFunction &MF) const {
207207

208208
// Reserve hardware registers.
209209
Reserved.set(Mips::HWR29);
210+
Reserved.set(Mips::HWR2);
210211

211212
// Reserve DSP control register.
212213
Reserved.set(Mips::DSPPos);

llvm/test/CodeGen/Mips/readcyclecounter.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
;RUN: llc -mtriple=mipsel -mcpu=mips2 < %s | FileCheck %s --check-prefix=MIPSEL_NOT_SUPPORTED
88
;RUN: llc -mtriple=mips64el -mcpu=mips3 < %s | FileCheck %s --check-prefix=MIPS64EL_NOT_SUPPORTED
99

10-
; XFAIL: expensive_checks
11-
1210
declare i64 @llvm.readcyclecounter() nounwind readnone
1311

1412
define i64 @test_readcyclecounter() nounwind {

0 commit comments

Comments
 (0)