[llvm-commits] [llvm] r95454 - in /llvm/trunk: lib/Transforms/Scalar/LoopUnrollPass.cpp test/CodeGen/X86/nancvt.ll

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Feb 5 16:41:19 PST 2010


On Feb 5, 2010, at 4:30 PM, Duncan Sands wrote:

> Hi Jakob,
> 
>>>> Don't unroll loops containing function calls.
>>> what is the reasoning behind this?
>> A function call is likely to take a significant amount of time, so the relative gain from unrolling the loop is very small. The code size increase is still there, though.
> 
> is this based on experimental results?

I wish, but no.

We have seen some cases (almabench) where loop unrolling could prevent inlining because the calling function became too big, and the inliner backed off. In these cases it is better to have deep inlining in a loop than having the loop unrolled without inlining.

If you have examples of bad regressions caused by this, I would like to know.

/jakob





More information about the llvm-commits mailing list