Fix register elimination for INC/DEC RTL instructions.
This patch corrects a typo in the LRA pass that prevented the proper elimination of hard registers for increment/decrement RTL instructions.
A typo in the LRA (Local Register Allocator) pass caused the compiler to incorrectly identify pseudos (pseudo registers) instead of hard registers when processing INC and DEC RTL (Register Transfer Language) instructions. This prevented the elimination of hard register operands, potentially leading to suboptimal register allocation. The patch corrects the condition to properly consider hard registers, allowing for more effective register elimination.
In Details
In lra-eliminations.cc, within the mark_not_eliminable function, the condition used to prevent the elimination of hard register operands for PRE/POST_INC/DEC and PRE/POST_MODIFY RTL instructions was incorrectly checking for pseudos instead of hard regs. This patch corrects this condition, ensuring that the intended hard registers are correctly identified and marked as non-eliminable. LRA is a critical component for register allocation, and this fix improves its accuracy.
For Context
Register allocation is a crucial phase in compilation where the compiler assigns program variables to physical registers in the CPU. The Local Register Allocator (LRA) is responsible for managing register allocation within basic blocks of code. Register elimination is a technique used to avoid unnecessary register moves, improving code efficiency. This patch fixes an error that prevented LRA from correctly identifying registers used in increment and decrement operations, potentially hindering optimization.