On Thu, Dec 10, 2015 at 12:26:10PM +0100, Bernd Schmidt wrote: > On 12/10/2015 09:08 AM, Jakub Jelinek wrote: > >On Wed, Dec 09, 2015 at 06:23:22PM +0100, Bernd Schmidt wrote: > >>On 12/09/2015 05:24 PM, Thomas Schwinge wrote: > >>> > >>>In addition to that, how about we split up gcc/omp-low.c into several > >>>files? Would it make sense (I have not yet looked in detail) to do so > >>>along the borders of the several passes defined therein? Or, can you > >>>tell already that there would be too many cross-references between the > >>>several files to make this infeasible? > >> > >>It would be nice to get rid of all the code duplication in that file. That > >>alone could reduce the size by quite a bit, and hopefully make it easier to > >>read. > > > >What exact code duplication do you mean? > > Functions that are near-identical with slight differences, or which have > large sections of identical code. scan_omp_task vs scan_omp_parallel, or the
Even these two (quite short) have huge number of differences, so I'm not 100% sure it would be more readable if we had just one scan_omp_taskreg that handled both. > various expand_omp_for functions are examples. I'm aware of some duplication in expand_omp_for_* functions, and some of the obvious duplications were already moved to helper functions. But in these cases the number of differences is even significantly bigger too, so having just one function that would handle all the different schedules would be far less readable. Perhaps we can add some small helpers to handle some little pieces that repeat between the functions. Jakub