On Tue, 2018-05-29 at 17:04 +0100, Bin.Cheng wrote: > On Fri, May 4, 2018 at 5:24 PM, Bin Cheng <bin.ch...@arm.com> wrote: > > Hi, > > This patch restricts predcom pass using register pressure > > information. > > In case of high register pressure, we now prune additional chains > > as well > > as disable unrolling in predcom. In generally, I think this patch > > set is > > useful. > > > > Bootstrap and test on x86_64 ongoing. Any comments? > > Simple update in line with changes in previous patch. > > Thanks, > bin > > > > Thanks, > > bin > > 2018-04-27 Bin Cheng <bin.ch...@arm.com> > > > > * tree-predcom.c (stor-layout.h, tree-ssa-live.h): Include. > > (REG_RELAX_RATIO, prune_chains): New. > > (tree_predictive_commoning_loop): Compute reg pressure > > using class > > region. Prune chains based on reg pressure. Force to not > > unroll > > if reg pressure is high.
[...snip...] > @@ -3239,6 +3301,11 @@ tree_predictive_commoning_loop (struct loop *loop) > /* Try to combine the chains that are always worked with together. */ > try_combine_chains (loop, &chains); > > + region = new lr_region (loop, max_pressure, NULL, NULL, NULL); > + high_pressure_p = region->calculate_pressure (); > + delete region; > + prune_chains (&chains, max_pressure); > + Possibly a silly question, but why the new/delete of "region" here? Couldn't this just be an on-stack object, with something like: lr_region region (loop, max_pressure, NULL, NULL, NULL); high_pressure_p = region.calculate_pressure (); prune_chains (&chains, max_pressure); or: { lr_region region (loop, max_pressure, NULL, NULL, NULL); high_pressure_p = region.calculate_pressure (); } prune_chains (&chains, max_pressure); if it's important to do the cleanup before prune_chains? Dave