[PATCH] D21887: Reduce number of getOffset calls.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 30 13:00:10 PDT 2016


Unfortunately benchmarking this I got only very small variations. See
attached file for details.

Cheers,
Rafael


On 30 June 2016 at 03:39, Rui Ueyama <ruiu at google.com> wrote:
> ruiu created this revision.
> ruiu added a reviewer: rafael.
> ruiu added a subscriber: llvm-commits.
>
> Mergeable sections usually don't have relocations, so this piece
> of code is being used to skip dead EH frames. This patch make it
> explicit so that we don't needlessly spend time on getOffset.
>
> http://reviews.llvm.org/D21887
>
> Files:
>   ELF/Relocations.cpp
>
> Index: ELF/Relocations.cpp
> ===================================================================
> --- ELF/Relocations.cpp
> +++ ELF/Relocations.cpp
> @@ -535,8 +535,9 @@
>        continue;
>
>      // Skip a relocation that points to a dead piece
> -    // in a mergeable section.
> -    if (C.getOffset(RI.r_offset) == (uintX_t)-1)
> +    // in an .eh_frame section.
> +    if (isa<EhInputSection<ELFT>>(&C) &&
> +        C.getOffset(RI.r_offset) == (uintX_t)-1)
>        continue;
>
>      // This relocation does not require got entry, but it is relative to got and
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: times
Type: application/octet-stream
Size: 678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160630/636e6fc1/attachment.obj>


More information about the llvm-commits mailing list