On Mon, 17 Nov 2025, Michael Matz wrote: > Hello, > > On Mon, 17 Nov 2025, Richard Biener wrote: > > > I suppose all passes that eventually care about profile (jump threading > > does, in its cost metrics, via maybe_hot/optimize_edge_for_speed, > > falling back to global defaults) would benefit from some kind of > > reasonable local profile. > > > > Now, I can simply move early LIM later, right after pass_profile > > for example. I'd expect if-to-switch / switch-convert disrupting > > the profile. > > > > Any ideas here? > > As a full LIM follows later anyway there's always the option to make the > early one not depend on a proper profile, but rather just _never_ move > expense operations out of their containing loops. That will disable it on > some loops, but that's also the case without any early LIM at all, after > all :)
Yes. This needs LIM to first consider "inexpensive" stmts to be still moveable in such situation (it currently simply stops for everything), or alternatively this will result in only hoisting up to a single level. I'd have to check whether hoisting across an early loop exit is also restricted (we usually still have loop headers in front of loops during early opts). There's more issues though, I'll followup with a "final" patch indicating what goes wrong with the remaining FAILs and I'm putting this on the side for now (aka, next stage1). Richard. > > > Ciao, > Michael. > -- Richard Biener <[email protected]> SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Jochen Jaser, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)
