[GHC] #8962: compile hang and memory blowup when using profiling and optimization