Commit f7f8bae
authored
[TableGen][NFCI] Speed up generating *GenRegisterInfo.inc files on builds with expensive checks. (llvm#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.1 parent fff1680 commit f7f8bae
1 file changed
+12
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2297 | 2297 | | |
2298 | 2298 | | |
2299 | 2299 | | |
2300 | | - | |
2301 | | - | |
| 2300 | + | |
| 2301 | + | |
2302 | 2302 | | |
2303 | 2303 | | |
2304 | 2304 | | |
| |||
2310 | 2310 | | |
2311 | 2311 | | |
2312 | 2312 | | |
2313 | | - | |
| 2313 | + | |
2314 | 2314 | | |
2315 | 2315 | | |
2316 | 2316 | | |
2317 | 2317 | | |
2318 | | - | |
| 2318 | + | |
2319 | 2319 | | |
2320 | 2320 | | |
2321 | 2321 | | |
| |||
2334 | 2334 | | |
2335 | 2335 | | |
2336 | 2336 | | |
2337 | | - | |
2338 | | - | |
2339 | | - | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
2340 | 2344 | | |
2341 | 2345 | | |
2342 | 2346 | | |
2343 | 2347 | | |
2344 | 2348 | | |
2345 | 2349 | | |
2346 | | - | |
| 2350 | + | |
2347 | 2351 | | |
2348 | 2352 | | |
2349 | 2353 | | |
| |||
0 commit comments