Re: [PATCH v3] Fix incomplete computation in fill_always_executed_in_1

2021-08-31 Thread Richard Biener via Gcc-patches
On Tue, 31 Aug 2021, Xionghu Luo wrote: > > > On 2021/8/30 17:19, Richard Biener wrote: > bitmap_set_bit (work_set, loop->header->index); > + unsigned bb_index; > - for (i = 0; i < loop->num_nodes; i++) > -{ > - edge_iterator ei; >

Re: [PATCH v3] Fix incomplete computation in fill_always_executed_in_1

2021-08-31 Thread Xionghu Luo via Gcc-patches
On 2021/8/30 17:19, Richard Biener wrote: bitmap_set_bit (work_set, loop->header->index); + unsigned bb_index; - for (i = 0; i < loop->num_nodes; i++) - { - edge_iterator ei; - bb = bbs[i]; + unsigned array_size = last_basic_block_for_fn (cfun) + 1;

Re: [PATCH v3] Fix incomplete computation in fill_always_executed_in_1

2021-08-30 Thread Richard Biener via Gcc-patches
g of the loop header successors, > >>>>> processing further blocks if all entries (ignoring backedges) are > >>>>> processed, setting SET_ALWAYS_EXECUTED_IN. When the worklist > >>>>> is empty proceed to inner loops as the current code does

Re: [PATCH v3] Fix incomplete computation in fill_always_executed_in_1

2021-08-30 Thread Xionghu Luo via Gcc-patches
execution time is 25 ms after code refine. It's even better than A. Attached the test case ssa-lim-22.c used for time measurement. Bumped the patch to v3 with TODOs: 1. The time measurement code will be removed if the v3 is OK; 2. loops_list is not used as my code is not re

Re: [PATCH v3] Fix incomplete computation in fill_always_executed_in_1

2021-08-27 Thread Richard Biener via Gcc-patches
_p (worklist)) > >>> { > >>> bb = pop (worklist); > >> > >> Need check whether bb dominates latch before SET_ALWAYS_EXECUTED_IN? > > > > Ah, sure. > > > >>> SET_ALWAYS_EXECUTED_IN (bb, loop); > >>>

Re: [PATCH v3] Fix incomplete computation in fill_always_executed_in_1

2021-08-25 Thread Xionghu Luo via Gcc-patches
;>> { >>> if (!flow_bb_inside_loop_p (loop, e->dest)) >>> continue; >>> if (incoming_count[e->dest->index]-- == 0) >>> push (worklist, e->dest); >>> } >&