Use functions for the INSN_FROM_TARGET_P flag
Replaces a macro with a function for managing the INSN_FROM_TARGET_P flag on instructions.
This commit replaces the INSN_FROM_TARGET_P macro with a dedicated function, set_insn_from_target, which operates on rtx_insn*. This change improves the robustness and clarity of instruction flag management within GCC’s internal representation. The flag is used in instruction reordering and delay slot filling, and this refactoring ensures safer access and modification.
In Details
This commit converts the INSN_FROM_TARGET_P macro and its setter into an inline function that takes an rtx_insn*. This improves type safety and encapsulation for instruction flags. The INSN_FROM_TARGET_P flag is relevant in instruction reordering and delay slot optimization, indicating if an instruction was moved from a target instruction sequence. This change aligns with the broader effort to use function-based APIs for RTX manipulation.
- RTX
- Representation of intermediate values in GCC. It's a tree-like data structure used to represent expressions, instructions, and other program elements during compilation.
- rtx_insn*
- A pointer to an RTX specifically representing a machine instruction.
- delay slot
- A processor architecture feature where the instruction immediately following a branch or jump instruction is executed regardless of the branch condition. Compilers must fill these slots with useful instructions or no-ops.