[PATCH] D44814: [CodeGenPrepare] Split huge basic blocks for faster compilation.

Michael Zolotukhin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 2 15:50:14 PDT 2018


mzolotukhin added a comment.

> I don't know how I feel about this patch. It looks like it's papering over a huge problem, which is basically the fact that some passes down the road are either quadratic or linear with large constant factor.
>  If we have examples of the broken passes, maybe we should consider whether it's feasible to fix them instead of applying this hack here?

We do have examples of such passes, and we should fix them, I agree. However, I don't consider this patch as a fix for them. The purpose of this patch is to prevent compiler hangs in future - even when we fix the known issues, there is no guarantee that there are no more places like them. When we specifically want to look for such problematic spots, we can always set the option to -1, but by default it will just save us from "compiler hangs" (at least, from those coming from backend).

> How was this picked?

The threshold was picked kind of randomly with the intention to make it high enough so that it doesn't affect usual cases, and in the bad cases the compiler still finishes in a reasonable time. Also, when "bad" situation occurs we still should be able to identify the problematic pass by unusually high relative time consumed.

> Another question that I have for you is: how is this going to work when GlobalIsel will become the standard?
>  My understanding is that cross-BB codegen will remove the need for CodegenPrepare, so if we start relying on BBs to be split we need to preserve this functionality somehow.

It probably wouldn't work for GlobalISel (at least, to my understanding), but since GlobalISel operates on a wider scope, I expect that non-linearities would be discovered and fixed much quicker.

Thanks,
Michael


Repository:
  rL LLVM

https://reviews.llvm.org/D44814





More information about the llvm-commits mailing list