[llvm-commits] Cost Table Draft
Renato Golin Linaro
renato.golin at linaro.org
Fri Jan 18 16:24:14 PST 2013
On 19 January 2013 00:00, Evan Cheng <evan.cheng at apple.com> wrote:
> Another stylistic nitpick:
>
Thanks for the review. I made a note to self to review 80-column and
early-return checks before commit, and forgot about it. I'll fix it.
But my real question is whether the table should be sorted so the look up
> can be faster?
>
Yes, this is a good question, and one I made to myself in several forms. I
didn't do it yet because I thought it was overkill, since all tables have
only a handful of elements anyway. Also, remember than each table is
separate, so even if adding up all elements can reach a hundred or so, each
lookup will be of no more than a dozen, and usually only half of it.
If the tables get bigger, sorting in-place will be a good idea, but taking
care for not doing it every time we enter the function. A simple
constructor would do the job, but I'm not sure we should also avoid static
constructors. In any case, a simple static flag would do the job.
cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130119/6ac93663/attachment.html>
More information about the llvm-commits
mailing list