llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.02k stars 11.96k forks source link

Optimize bind opcode generation #50252

Open int3 opened 3 years ago

int3 commented 3 years ago
Bugzilla Link 50908
Version unspecified
OS All
CC @gkmhub,@int3,@smeenai

Extended Description

We currently encode significantly more bind opcodes than ld64. I estimate a roughly 5x (!) overhead when encoding the same number of bind & rebase entries.

Some ideas:

int3 commented 3 years ago

assigned to @int3

int3 commented 2 years ago

Bind opcode encoding is now much better after:

https://reviews.llvm.org/D105866 https://reviews.llvm.org/D105867 https://reviews.llvm.org/D106128

Thanks @thevinster!

Sort the GOT entries by dylib, so to minimize the number of BIND_OPCODE_SET_DYLIBORDINAL* opcodes

We haven't tried this yet, so leaving the task open for now