https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116689
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2024-09-12 Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed. Note the sink pass only moves to not post-dominated places (and the sink pass does not consider register pressure for example when sinking stores or loads). The sink pass also sinks common code through PHIs to CFG merges (only stores at the moment), in a separate mechanism. In principle we could enhance the sink pass to (optionally) sink stmts to the nearest place where it causes the least register pressure though I guess doing this greedily bottom-up as sink works does not result in an optimal schedule for register pressure purposes. Note on GIMPLE threre's TER which will wreck any scheduling that's done within TERs bounds (same basic-block, doesn't cross some special stmt kinds), but scheduling at basic-block granularity might be a win. Since we already compute liveness at out-of-SSA time we might as well implement this scheduling at out-of-SSA time.