File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -895,11 +895,9 @@ bool RISCVRegisterInfo::getRegAllocationHints(
895895 // Check if this register matches the even/odd requirement
896896 bool IsOdd = (RegNum % 2 != 0 );
897897
898- // Verify the pair register exists and is in the same register class
899- // TODO: Skip unallocatable registers: we need to prevent any of odd/even
900- // to be reserved, so if we need odd, we need to check if corresponding
901- // even is preserved, vice versa.
902- if ((WantOdd && IsOdd) || (!WantOdd && !IsOdd))
898+ // Don't provide hints that are paired to a reserved register.
899+ MCRegister Paired = PhysReg + (IsOdd ? -1 : 1 );
900+ if (WantOdd == IsOdd && !MRI->isReserved (Paired))
903901 Hints.push_back (PhysReg);
904902 }
905903 }
You can’t perform that action at this time.
0 commit comments