Re: Loop-ch improvements, part 3

2023-08-23 Thread Richard Biener via Gcc-patches
On Wed, 23 Aug 2023, Jan Hubicka wrote: > > We seem to peel one iteration for no good reason. The loop is > > a do-while loop already. The key is we see the first iteration > > exit condition is known not taken and then: > Hi, > this is patch fixing wrong return value in

Re: Loop-ch improvements, part 3

2023-08-23 Thread Jan Hubicka via Gcc-patches
> We seem to peel one iteration for no good reason. The loop is > a do-while loop already. The key is we see the first iteration > exit condition is known not taken and then: Hi, this is patch fixing wrong return value in should_duplicate_loop_header_p. Doing so uncovered suboptimal decisions on

Re: Loop-ch improvements, part 3

2023-08-22 Thread Jan Hubicka via Gcc-patches
> > We seem to peel one iteration for no good reason. The loop is > a do-while loop already. The key is we see the first iteration > exit condition is known not taken and then: > > Registering value_relation (path_oracle) (iter.24_6 > iter.24_5) (root: > bb2) > Stmt is static (constant

Re: Loop-ch improvements, part 3

2023-08-22 Thread Richard Biener via Gcc-patches
On Tue, 22 Aug 2023, Hongtao Liu wrote: > On Mon, Jul 17, 2023 at 5:18?PM Richard Biener via Gcc-patches > wrote: > > > > On Fri, 14 Jul 2023, Jan Hubicka wrote: > > > > > Hi, > > > loop-ch currently does analysis using ranger for all loops to identify > > > candidates and then follows by phase

Re: Loop-ch improvements, part 3

2023-08-21 Thread Hongtao Liu via Gcc-patches
On Mon, Jul 17, 2023 at 5:18 PM Richard Biener via Gcc-patches wrote: > > On Fri, 14 Jul 2023, Jan Hubicka wrote: > > > Hi, > > loop-ch currently does analysis using ranger for all loops to identify > > candidates and then follows by phase where headers are duplicated (which > > breaks SSA and

Re: loop-ch improvements, part 3

2023-07-20 Thread Richard Biener via Gcc-patches
On Thu, Jul 20, 2023 at 9:10 AM Jan Hubicka via Gcc-patches wrote: > > Hi, > this patch makes tree-ssa-loop-ch to understand if-combined conditionals > (which > are quite common) and remove the IV-derived heuristics. That heuristics is > quite dubious because every variable with PHI in header

loop-ch improvements, part 3

2023-07-20 Thread Jan Hubicka via Gcc-patches
Hi, this patch makes tree-ssa-loop-ch to understand if-combined conditionals (which are quite common) and remove the IV-derived heuristics. That heuristics is quite dubious because every variable with PHI in header of integral or pointer type is seen as IV, so in the first basic block we match

Re: Loop-ch improvements, part 3

2023-07-17 Thread Richard Biener via Gcc-patches
On Fri, 14 Jul 2023, Jan Hubicka wrote: > Hi, > loop-ch currently does analysis using ranger for all loops to identify > candidates and then follows by phase where headers are duplicated (which > breaks SSA and ranger). The second stage does more analysis (to see how > many BBs we want to

Loop-ch improvements, part 3

2023-07-14 Thread Jan Hubicka via Gcc-patches
Hi, loop-ch currently does analysis using ranger for all loops to identify candidates and then follows by phase where headers are duplicated (which breaks SSA and ranger). The second stage does more analysis (to see how many BBs we want to duplicate) but can't use ranger and thus misses