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
ity of this function. I would > >>>>> have suggested to do greedy visiting of the loop header successors, > >>>>> processing further blocks if all entries (ignoring backedges) are > >>>>> processed, setting SET_ALWAYS_EXECUTED_IN. When the wo

Re: [PATCH v3] Fix incomplete computation in fill_always_executed_in_1

2021-08-30 Thread Xionghu Luo via Gcc-patches
ter than O(n^2)? Sorry didn't get C's execution time accurate enough due to forgot to remove dump file code in it. C's 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

Re: [PATCH v3] Fix incomplete computation in fill_always_executed_in_1

2021-08-27 Thread Richard Biener via Gcc-patches
;> bitmap_set_bit (worklist, loop-header-bb); > >>> while (!bitmap_empty_p (worklist)) > >>> { > >>> bb = pop (worklist); > >> > >> Need check whether bb dominates latch before SET_ALWAYS_EXECUTED_IN? > > > > Ah, s

Re: [PATCH v3] Fix incomplete computation in fill_always_executed_in_1

2021-08-25 Thread Xionghu Luo via Gcc-patches
) >>> continue; >>> FOR_EACH_EDGE (e, ei, bb->succs) >>> { >>> if (!flow_bb_inside_loop_p (loop, e->dest)) >>> continue; >>> if (incoming_count[e->dest->index]-- =