]> git.ipfire.org Git - thirdparty/gcc.git/commit
ira: Handle register filters
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 21 Nov 2023 15:39:10 +0000 (15:39 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 21 Nov 2023 15:39:10 +0000 (15:39 +0000)
commitef4e6e2c04141f1654e0d7bc8e5674dad9cc3452
tree61db7cafaa27916ba952777d21047bfb1e3e093d
parent4095fac5a42e72e926f1f8c2cde5b8a621704111
ira: Handle register filters

This patch makes IRA apply register filters when picking hard registers.
All the new code should be optimised away on targets that don't use
register filters.  On targets that do use them, the new register_filters
bitfield is expected to be only a handful of bits.

Information about register filters is recorded in process_bb_node_lives.
The information isn't really related to liveness, but it's a convenient
point because (a) we've already built the allocno structures and
(b) we've already extracted the insn and preprocessed the constraints.

gcc/
* ira-int.h (ira_allocno): Add a register_filters field.
(ALLOCNO_REGISTER_FILTERS): New macro.
(ALLOCNO_SET_REGISTER_FILTERS): Likewise.
* ira-build.cc (ira_create_allocno): Initialize register_filters.
(create_cap_allocno): Propagate register_filters.
(propagate_allocno_info): Likewise.
(propagate_some_info_from_allocno): Likewise.
* ira-lives.cc (process_register_constraint_filters): New function.
(process_bb_node_lives): Use it to record register filter
information.
* ira-color.cc (assign_hard_reg): Check register filters.
(improve_allocation, fast_allocation): Likewise.
gcc/ira-build.cc
gcc/ira-color.cc
gcc/ira-int.h
gcc/ira-lives.cc