llvm / llvm/llvm-project

llvm-tblgen reg handling speedup

Open
#208,073 3 comments 0 reactions 0 assignees View on GitHub
performance tablegen
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

I looked at performance of the two worst offenders (amdgpu register bank emission
and register info). It seems to me that the way to get superregs is very slow.

It creates a bitvector of *all* register classes in a set. Then uses it once
(register bank emission) or a very few times. Perhaps it's meant to be cached,
no idea.

I removed this weirdness and got some very nice speedup (~70x for reg bank
emission, and ~10x for register info).

Contributor guide

Open the contributing guide

Research direction

Start in llvm-tblgen's superregister handling, focusing on AMDGPU register bank emission and register info, which the issue identifies as the main offenders. Profile the current bitvector construction and compare the affected operations with the proposed simpler approach. Done means preserving register handling while reproducing the reported speedups for register bank emission and register info.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.