[PATCH] D18069: Throttling LICM to reduce compile time of Value Propagation and Reg Splitting

Wei Mi via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 12 11:05:52 PST 2016


> GCC has two things that do LICM, PRE and tree-loop-licm.

Thanks for the explanation of PRE and LICM in GCC.

>> And I don't think doing opt aggressively without known benefit and
>> then nullify it is a good idea.
>
>
> This is a common point of contention in compilers.
> IME, most compilers fall on the side of "we don't try to take register
> pressure into account in the middle, because it's really hard to say what is
> going to happen 10+ passes down the road, and not easy to estimate
> accurately on today's architectures".
>
> GCC and LLVM definitely fall into that case.
>

Agree that usually we don't try to take register pressure into account
in the middle. But there is special case, like llvm interleave in
vectorization. I also don't try to get a precise register model to use
in middle end. I just want to obviate apparent non-beneficial cases
which only increase compile time. That is why I do the throttling in a
constrain way -- only on very large loops, only on cheap instruction,
and only when reg pressure is high based on estimation.

If I still see perf regression, I may either try getting the constrain
more strictly, or reflect if there is real deficiency to do it in this
way. It will be based on more testing (For my limited testing -- llvm
testsuite and google internal perf testing on x86-64, I havn't seen
regressions for now).

Thanks,
Wei.


More information about the llvm-commits mailing list