LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 51827 - Huge compile-time regression for Windows targets since LLVM 12, incl. latest 13-rc2
Summary: Huge compile-time regression for Windows targets since LLVM 12, incl. latest ...
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Common Code Generator Code (show other bugs)
Version: trunk
Hardware: PC Windows NT
: P release blocker
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-12 11:35 PDT by Martin Kinkelin
Modified: 2021-10-20 16:59 PDT (History)
6 users (show)

See Also:
Fixed By Commit(s): https://reviews.llvm.org/D111596


Attachments
xz-compressed bitcode input file (280.58 KB, application/x-xz)
2021-09-12 11:35 PDT, Martin Kinkelin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Kinkelin 2021-09-12 11:35:40 PDT
Created attachment 25252 [details]
xz-compressed bitcode input file

I'm seeing a codegen slowdown by about 2 orders of magnitude for the attached .bc file (generated by LDC, the LLVM D compiler) starting with LLVM 12.0.0. Seems to be specific to Windows/MSVC targets, and timings are back to normal when enabling the optimizer.

Using clang from the official LLVM Windows builds from GitHub and compiling via `clang -c template9.bc`:
* v11.0.1: ~2.4 seconds
* v12.0.1: ~246 seconds
* v13.0.0-rc2: ~227 seconds

Enabling the optimizer by adding `-O3` hints at a further little regression in v13:
* v11.0.1: ~3.3 seconds
* v12.0.1: ~3.3 seconds
* v13.0.0-rc2: ~5.0 seconds
Comment 1 Nikita Popov 2021-09-12 13:49:11 PDT
Looks like there's a function with 100000 stores in a block and we spend a lot of time in mergeConsecutiveStores() in DAGCombine.
Comment 2 Arthur Eubanks 2021-10-11 19:05:08 PDT
Proposed patch: https://reviews.llvm.org/D111596