[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:57:04 PST 2010


On Feb 5, 2010, at 4:50 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.
> 
> the loops I would like to be unrolled weren't unrolled before your change
> either, so I guess I'm not going to see any regressions due to this :)

Currently -unroll-threshold defaults to 100 instructions. That is a suspiciously round number.

It would be interesting to see some code size/performance vs. threshold graphs. If you have the time to do them...

/jakob





More information about the llvm-commits mailing list