llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.86k stars 11.92k forks source link

The code generator hangs. #75898

Open JavierASMR opened 10 months ago

JavierASMR commented 10 months ago

I have been experiencing this bug for three years. The compiler hangs when compiling with -O2 but not -O1. It does so whether I generate for x86_64 or arm. I attach the .bc file and the report. The latter includes towards its beginning:

LLVM ERROR: out of memory Allocation failed Stack dump:

  1. Running pass 'Function Pass Manager' on module 'bugpoint-test-program-baa9344.bc'.
  2. Running pass 'Loop Pass Manager' on function '@FicheroConfig___KeyVals'
  3. Running pass 'Induction Variable Users' on basic block '%49888'

I attach the report. The llc tool is still trying to cut down the problem, but at the pace it's going it will take it several years to complete. I have

bugpoint-reduced-simplifycfg.zip report_cut.txt

asl commented 10 months ago

@JavierASMR How much RAM do you have?

asl commented 10 months ago

Note that it's just one large function with ~15k BBs

JavierASMR commented 10 months ago

I've got 8GB of RAM. It's just this function. When it started three years ago the function wasn't that large. Maybe 2/3 of the current size. And I think I have compiled a much larger function without problem.

JavierASMR commented 10 months ago

I have removed most of the function's code. This should be easier to track. bugpoint-reduced-function.zip