On 10/24/23 11:58, Richard Sandiford wrote:
rtl_ssa::changes_are_worthwhile used the standard approach of summing up the individual costs of the old and new sequences to see which one is better overall. But when optimising for speed and changing instructions in multiple blocks, it seems better to weight the cost of each instruction by its execution frequency. (We already do something similar for SLP layouts.) gcc/ * rtl-ssa/changes.cc: Include sreal.h. (rtl_ssa::changes_are_worthwhile): When optimizing for speed, scale the cost of each instruction by its execution frequency.
Agreed that it seems better. OK. Jeff