This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][libstdc++-v3 parallel mode]
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Johannes Singler <singler at ira dot uka dot de>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 14 Nov 2007 10:16:10 -0600
- Subject: Re: [PATCH][libstdc++-v3 parallel mode]
- References: <47396352.3080706@ira.uka.de>
This is fine.
> + for (int t = 0; t < k; t++)
> + {
> + if (stable)
> + {
> + if (seqs_begin[t].first == seqs_begin[t].second)
> + lt.insert_start_stable(*arbitrary_element, t, true);
> + else
> + lt.insert_start_stable(*seqs_begin[t].first, t, false);
> + }
> + else
> + {
> + if (seqs_begin[t].first == seqs_begin[t].second)
> + lt.insert_start(*arbitrary_element, t, true);
> + else
> + lt.insert_start(*seqs_begin[t].first, t, false);
> + }
> }
Code like this (and other parts of this file) makes me
think that this loop could be peeled via a template parameter on
the function (or lt object), and structure the code for this function as
a stable/notstable specializations (ie, stable policy). (or as
stable/non-stable specializations of LT.)
Just a thought.
It would probably be a lot cleaner.
-benjamin