[all-commits] [llvm/llvm-project] f7f8ba: [TableGen][NFCI] Speed up generating *GenRegisterI...
Ivan Kosarev via All-commits
all-commits at lists.llvm.org
Mon Sep 25 11:13:43 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f7f8bae7a9ba3ec2273577ad4316fb4f0c91b2c9
https://github.com/llvm/llvm-project/commit/f7f8bae7a9ba3ec2273577ad4316fb4f0c91b2c9
Author: Ivan Kosarev <ivan.kosarev at amd.com>
Date: 2023-09-25 (Mon, 25 Sep 2023)
Changed paths:
M llvm/utils/TableGen/CodeGenRegisters.cpp
Log Message:
-----------
[TableGen][NFCI] Speed up generating *GenRegisterInfo.inc files on builds with expensive checks. (#67340)
This is mostly AMDGPU-specific. When the expensive checks are enabled,
generating of AMDGPUGenRegisterInfo.inc currently takes about 20 minutes
on my machine for release+asserts builds, which effectively prevents
such testing from regular use. This patch fixes this by reducing the
time to about 2 minutes.
Generation times for AMDGPUGenRegisterInfo.inc without expensive checks
and other *GenRegisterInfo.inc files with and without the expensive
checks remain approximately the same.
The patch doesn't cause any changes in the contents of the generated
files.
The root cause of the current poor performance is that where glibcxx is
used, enabling the expensive checks defines _GLIBCXX_DEBUG, which
enables various consistency checks in the library. One such check is in
std::binary_search() to make sure the range is ordered. As
CodeGenRegisterClass::contains() relies on std::binary_search() and it
is called very a large number of times from within
CodeGenRegBank::inferMatchingSuperRegClass(), the libcxx checks heavily
affect the runtimes.
More information about the All-commits
mailing list