OSDN Git Service

[SCEV] Properly handle the case of a non-constant start with a zero accum in ScalarEv...
authorDaniel Neilson <dneilson@azul.com>
Wed, 11 Oct 2017 19:05:14 +0000 (19:05 +0000)
committerDaniel Neilson <dneilson@azul.com>
Wed, 11 Oct 2017 19:05:14 +0000 (19:05 +0000)
commit7d7645fe0b3495ab4c84ff33fdd3f03ebdef43db
tree5386a3e3d8c80facd003c92cb08ade72e08b9b47
parentb6e79fcc2a28c69a6c627f0e980bc8a59b529efe
[SCEV] Properly handle the case of a non-constant start with a zero accum in ScalarEvolution::createAddRecFromPHIWithCastsImpl

Summary:
 This patch fixes an error in the patch to ScalarEvolution::createAddRecFromPHIWithCastsImpl
made in D37265. In that patch we handle the cases where the either the start or accum values can be
zero after truncation. But, we assume that the start value must be a constant if the accum is
zero. This is clearly an erroneous assumption. This change removes that assumption.

Reviewers: sanjoy, dorit, mkazantsev

Reviewed By: sanjoy

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D38814

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315491 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolution.cpp
unittests/Analysis/ScalarEvolutionTest.cpp