[llvm-dev] Saving Compile Time in InstCombine

Davide Italiano via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 22 18:45:56 PDT 2017


On Wed, Mar 22, 2017 at 6:29 PM, Mikhail Zolotukhin via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>
> In my testing results are not that impressive, but that's because I'm now focusing on Os. For me even complete disabling of all KnownBits-related patterns in InstCombine places the results very close to the noise level. In my original patch I also had some extra patterns moved under ExpensiveCombines - and that seems to make a difference too (without this part, or without the KnownBits part I get results below 1%, which are not reported as regressions/improvements).
>

Have you profiled a single InstCombine run to see where we actually
spend our cycles (as Sanjay did for his reduced testcase)?

> I realize that InstCombine doesn't usually do any harm, if we don't care about compile time, but that's only the case for O3 (to some extent), not for other optimization levels.

Independently from what's the optimization level, I think compile-time
is important. Note, for example, that we run a (kinda) similar
pipeline at O3 and LTO (full, that is), where the impact of compile
time is much more evident. Also, while people are not generally bitten
by O3 compilation time, you may end up with terrible performances for
large TUs (and I unfortunately learned this the hard way).

--
Davide


More information about the llvm-dev mailing list