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
Looks like there's a function with 100000 stores in a block and we spend a lot of time in mergeConsecutiveStores() in DAGCombine.
Proposed patch: https://reviews.llvm.org/D111596