[LRA]: Backporting solutions for PR112918 and PR113354 to solve PR99015
Patches for PR112918 and PR11354 depend on each other and can not be
clearly applied to gcc-13 branch. So patches were modified and
combined.
gcc/ChangeLog:
PR rtl-optimization/99015
* lra-constraints.cc (enough_allocatable_hard_regs_p): Extract
from in_class_p.
(in_class_p): Use it with added conditions.
(process_alt_operands): Try to change class too.
(curr_insn_transform): Pass true to in_class_p for reg operand
win. Spill pseudo only used in the insn if the corresponding
operand does not require hard register anymore.