Skip to content

Commit 44f5809

Browse files
committed
fixup! skip preserved register
1 parent 2a87065 commit 44f5809

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,9 @@ bool RISCVRegisterInfo::getRegAllocationHints(
895895
// Check if this register matches the even/odd requirement
896896
bool IsOdd = (RegNum % 2 != 0);
897897

898+
// Skip unallocatable registers.
899+
if (MRI->isReserved(PhysReg))
900+
continue;
898901
// Verify the pair register exists and is in the same register class
899902
if ((WantOdd && IsOdd) || (!WantOdd && !IsOdd))
900903
Hints.push_back(PhysReg);

0 commit comments

Comments
 (0)