[lld] r317026 - Revert r316305: Remove a fast lookup table from MergeInputSection.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 20:26:17 PDT 2017


Rui Ueyama <ruiu at google.com> writes:

> On Fri, Nov 3, 2017 at 6:00 PM, Rafael Avila de Espindola <
> rafael.espindola at gmail.com> wrote:
>
>> One last thing I remembered. Most of the regression is because of massive
>> branch mis prediction, which is not surprising in a hot binary search.
>>
>> In http://cglab.ca/~morin/misc/arraylayout-v2/ there more efficient
>> algorithms that don't need mis predicted branches.
>>
>
> None of these algorithms can eliminate branch mis-predictions no? They
> might be have better memory locality, but but they don't seem to improve
> branch prediction.

They can in two ways

* No branch inside the loop.
* The search always iterates the same number of times.

The first one is the problem where clang would convert a "a = foo ? bar
: zed" into a branch.

Cheers,
Rafael


More information about the llvm-commits mailing list