https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80155
--- Comment #44 from Jeffrey A. Law <law at redhat dot com> --- I'd be very hesitant to make the cost model target specific. It goes against core design goals of gimple. Conceptually I believe we should be optimizing as much as possible on gimple and that issues such as register pressure should be addressed at the gimple->rtl border and later, not by throttling the gimple optimizers. You could potentially look at Cliff Click's work from '95. It could probably be repurposed as a general lifetime shrinking pass through statement scheduling within blocks and across blocks. You could also look at reviving Bernd's work which tries to do statement scheduling near the gimple->rtl border.