[PATCH] D27145: Add "RPRED" mechanism for relocation predicates. (5% speedup for `ld.lld -O0`)

Joerg Sonnenberger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 27 03:17:28 PST 2016


joerg added a comment.

I'm not convinced that a better switch encoding logic by the compiler can't be done. In fact it seems to be quite reasonable to expect

  if (x == C1 || x == C2 || ... || x == C_N)

to be turned into

  if (x>=0 && x < 64 && (1ULL << (x&63)) & ((1ULL << C1) | (1ULL << C2) | ....| (1ULL << C_N))

as a general optimisation if all C_i<64.


https://reviews.llvm.org/D27145





More information about the llvm-commits mailing list