[llvm] r251839 - [IndVarSimplify] Rewrite loop exit values with their initial values from loop preheader

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 3 00:00:47 PST 2015


On 11/03/2015 08:19 AM, Tobias Grosser via llvm-commits wrote:
> On 11/02/2015 11:00 PM, Chen Li via llvm-commits wrote:
>> Author: chenli
>> Date: Mon Nov  2 16:00:15 2015
>> New Revision: 251839
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=251839&view=rev
>> Log:
>> [IndVarSimplify] Rewrite loop exit values with their initial values
>> from loop preheader
>>
>> Summary:
>> This patch adds support to check if a loop has loop invariant
>> conditions which lead to loop exits. If so, we know that if the exit
>> path is taken, it is at the first loop iteration. If there is an
>> induction variable used in that exit path whose value has not been
>> updated, it will keep its initial value passing from loop preheader.
>> We can therefore rewrite the exit value with
>> its initial value. This will help remove phis created by LCSSA and
>> enable other optimizations like loop unswitch.
>
> Hi Chen Li,
>
> this commit broke some of my bots. I reverted it in r251901. As it may
> have just triggered a bug in my code, I will investigate first and send
> you more information subsequently.

The revert fixed the Polly buildbots, but also a an aarach64 bot that 
does not use any Polly:

http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/1978
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/1979

For the polly buildbot I confirmed that the issues also showed up when 
running with --mllvm=-polly --mllvm=-polly-only-scop-detection. In this 
configuration Polly is running an additional round of indvarsimplify at 
the beginning of the pass pipeline, but no polly specific transformation
passes.

Hence, it seems the issues we see here are indeed miscompiles due to 
this enhanced version of indvarsimplify.

Best,
Tobisa


More information about the llvm-commits mailing list