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

Chen Li via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 10:04:12 PST 2015


Thanks! I'll run the test and see if I can find the bug.

Chen

Sent from my iPhone

> On Nov 3, 2015, at 12:02 PM, Tobias Grosser <tobias at grosser.es> wrote:
> 
>> On 11/03/2015 08:47 PM, Chen Li wrote:
>> 
>>> On Nov 3, 2015, at 12:00 AM, Tobias Grosser <tobias at grosser.es
>>> <mailto:tobias at grosser.es>> wrote:
>>> 
>>>> 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.
>> 
>> Hi Tobias,
>> 
>> Sorry for the bug. Could you please give me some instructions to
>> reproduce the crash? Thanks!
> 
> With Polly, this command caused a execution time failure for me on x86:
> 
> mysandbox/bin/lnt runtest nt --sandbox /tmp/bar --cc /home/grosser/Projects/polly/cmake_opt/bin/clang --cxx /home/grosser/Projects/polly/cmake_opt/bin/clang++ --test-suite test-suite/ -j4 --only-test MultiSource/Benchmarks/Prolangs-C/bison --cflag="-Xclang -load" --cflag="-Xclang /home/grosser/Projects/polly/cmake_opt/lib/LLVMPolly.so" --mllvm=-polly --mllvm=-polly-only-scop-detection
> 
> Another option may be to look at the other, non-polly bots that got green after my commit. The aarch64 bot mentioned above is one of them.
> 
> Best,
> Tobias


More information about the llvm-commits mailing list