aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2022-01-10 14:47:07 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2022-01-10 14:47:07 +0000
commitbf37fd35a37985a0e19817f843d0bdd5ad504aa9 (patch)
tree18f11c46d70b04c1791c53656c61a6e57b463e10 /gcc/tree-vect-loop.c
parenta8d3c98746098e2784be7144c1ccc9fcc34a0888 (diff)
downloadgcc-bf37fd35a37985a0e19817f843d0bdd5ad504aa9.zip
gcc-bf37fd35a37985a0e19817f843d0bdd5ad504aa9.tar.gz
gcc-bf37fd35a37985a0e19817f843d0bdd5ad504aa9.tar.bz2
ira: Add a ira_loop_border_costs class
The final index into (ira_)memory_move_cost is 1 for loads and 0 for stores. Thus the combination: entry_freq * memory_cost[1] + exit_freq * memory_cost[0] is the cost of loading a register on entry to a loop and storing it back on exit from the loop. This is the cost to use if the register is successfully allocated within the loop but is spilled in the parent loop. Similarly: entry_freq * memory_cost[0] + exit_freq * memory_cost[1] is the cost of storing a register on entry to the loop and restoring it on exit from the loop. This is the cost to use if the register is spilled within the loop but is successfully allocated in the parent loop. The patch adds a helper class for calculating these values and mechanically replaces the existing instances. There is no attempt to editorialise the choice between using “spill inside” and “spill outside” costs. (I think one of them is the wrong way round, but a later patch deals with that.) No functional change intended. gcc/ PR rtl-optimization/98782 * ira-int.h (ira_loop_border_costs): New class. * ira-color.c (ira_loop_border_costs::ira_loop_border_costs): New constructor. (calculate_allocno_spill_cost): Use ira_loop_border_costs. (color_pass): Likewise. (move_spill_restore): Likewise.
Diffstat (limited to 'gcc/tree-vect-loop.c')
0 files changed, 0 insertions, 0 deletions