pingcap / pingcap/tiflash

Introduce IFUNC facilities and port more optimizations onto aarch64

Open
#5,250 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/enhancement
Dominant language
C++
Stars
1k
Forks
423
Avg merge
1d 15h
Merged PRs (30d)
24

Description

Enhancement

In #5248, TIFLASH_MULTIVERSIONED_VECTORIZATION is introduced to automatically generate IFUNC dispatched functions for TiFlash.

As an example, deserializeBinarySSE2 is updated to deserializeBinaryBlockImpl, where manually written inline asm for SSE2 optimization is replaced with tiflash_compiler_builtin_memcpy, which generates vectorized machine code of same quality with the original ones.
In the same time, a special version for x86-64 targets is provided, which utilizing ERMS technique for very long strings.


In #5251, more changes on top of #5248 are introduced, focusing on dispatching DMVersionFilterBlockInputStream.

image


As a clarification and a tip for future: clang 13 does not yet support auto vectorization utilizing SVE/SVE2 but clang 14 is ready for doing so. The code take SVE/SVE2 cases into consideration and it is tested to work on godbolt.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading #5248 and #5251, then trace the mentioned deserializeBinarySSE2/deserializeBinaryBlockImpl and DMVersionFilterBlockInputStream paths. Review how tiflash_compiler_builtin_memcpy and the clang 13/14 SVE/SVE2 behavior relate to the proposed dispatching. Done means introducing the IFUNC facilities and porting the identified optimizations to aarch64 while preserving the stated x86-64 behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.