This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] Generalize get_most_common_single_value to return k_th value & count


On Mon, Jul 15, 2019 at 04:41:28PM +0200, Martin Liška wrote:
> On 7/15/19 4:31 PM, Segher Boessenkool wrote:
> > On Mon, Jul 15, 2019 at 04:23:18PM +0200, Martin Liška wrote:
> >> On 7/15/19 4:17 PM, Segher Boessenkool wrote:
> >>> Is that enough?  Can there be two entries with the same count as well
> >>> as value?
> >>
> >> Yes, it can happen very unlikely in a multi-threaded instrumentation,
> >> but it will not make a problem.
> > 
> > It will result in different sort order on different hosts, then.  Is
> > that okay here?  Does a different order here not lead to different
> > compiler output?
> 
> The memory layout of the {value, count} tuple can be different. But the
> function will return you K-th most common value. And that will return the same.

Ah okay, we only look at the value later.  This should be documented I
think (just in the comparison routine is fine).


Segher


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]