This patch builds on top of D13378 to handle constant condition.
authorMehdi Amini <mehdi.amini@apple.com>
Tue, 6 Oct 2015 17:19:20 +0000 (17:19 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Tue, 6 Oct 2015 17:19:20 +0000 (17:19 +0000)
commite79f96c7c6aa2fb1117757581a6f96cac636a58e
treec5422eab78ed821dcf338957e7c6aad17091f27f
parent63c550368d0999cd1f4d68e9d26d244eca9d5068
This patch builds on top of D13378 to handle constant condition.

With this patch, clang -O3 optimizes correctly providing > 1000x speedup on this artificial benchmark):

for (a=0; a<n; a++)
    for (b=0; b<n; b++)
        for (c=0; c<n; c++)
            for (d=0; d<n; d++)
                for (e=0; e<n; e++)
                    for (f=0; f<n; f++)
                        x++;
From test-suite/SingleSource/Benchmarks/Shootout/nestedloop.c

Reviewers: sanjoyd

Differential Revision: http://reviews.llvm.org/D13390

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249431 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/constant_condition.ll [new file with mode: 0644]