On Sun, 2025-10-19 at 20:55 -0700, Andrew Pinski wrote:
> In expand, a bunch of places chose between 2 sequences based on if
> the cost
> is less. Currently this is done manually and does NOT always print
> out
> which one is selected and their costs.
> 
> This adds a 2 classes which is designed to record the sequences and
> choose one of
> them based on their cost.
> This is a RFC rather than a full patch as I don't like the class
> names I came up with.
> It transform one example to use the new class to show how it will be
> used.
> There is at least one place where I was going to choose between more
> than 2 sequences, that
> is why I used a vec here (though with a reserved space for 3
> elements). I suspect this would
> be used more if this in is in place as it should make it easier add a
> new sequence for choosing.
> 
> Note I know I misspelled choose as chose. I will correct before
> submitting the full path; but I
> wanted to get people thoughts on the overall idea before fixing it
> up.
> 
> The 2 questions I have is:
> 1) is this a good idea to handle the choice between 2 (or more)
> sequences done
> this way or should the code kept like it was before?
> 2) better names for the 2 structs/classes?

If I can bike-shed, how about:

  class pick_cheapest;
  class candidate; (possibly an inner class of the above)

where the defn of what is "cheapest" is of course affected by the
user's choice of size vs speed.

Hope this is constructive
Dave

Reply via email to