GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc

Pass an rtx_insn* to update_reg_unused_notes.

Pass an rtx_insn* to update_reg_unused_notes for improved register tracking.

This commit modifies the update_reg_unused_notes function in reorg.cc to accept an rtx_insn *. The function fill_slots_from_thread is also updated to keep its scan cursor in an rtx_insn *. These changes refine how unused register notes are managed, ensuring that the context of the instruction being processed is accurately maintained, which is beneficial for optimization passes that track register liveness.

In Details

The update_reg_unused_notes function in reorg.cc now accepts an rtx_insn *, providing it with a direct pointer to the instruction being analyzed. Similarly, fill_slots_from_thread uses an rtx_insn * as its scan cursor. This change likely improves the accuracy of register usage tracking and note management within the RTL reordering passes by ensuring that specific instruction context is always available, rather than relying on potentially stale or broader RTL contexts.

For Context
rtx_insn
An RTX (Real-Time Expression) object representing a GCC internal representation of a machine instruction. rtx_insn * is a pointer to such an instruction.
update_reg_unused_notes
A GCC internal function likely responsible for updating notes related to registers that are no longer used, helping the compiler to optimize register allocation and usage.
fill_slots_from_thread
A GCC internal function possibly related to instruction scheduling or optimization, which might fill delay slots or other instruction-related slots using information from a 'thread' or sequence.
RTL
Register Transfer Language, an intermediate representation used by GCC to represent code between parsing and machine-specific code generation. It's a Lisp-like language of expressions.
Filed Under: rtloptimization