[SCEV] Consistently Handle Expressions That Cannot Be Divided
authorMatthew Simpson <mssimpso@codeaurora.org>
Thu, 10 Sep 2015 18:12:47 +0000 (18:12 +0000)
committerMatthew Simpson <mssimpso@codeaurora.org>
Thu, 10 Sep 2015 18:12:47 +0000 (18:12 +0000)
commitcc8cfb98753e658a0ec7d49a77f146571bdbf77b
tree7481226307a9517a80f0bc1aa53338560493e0aa
parent50c9e6310eceb4696b3fb7ea9845cd9c868d4dfc
[SCEV] Consistently Handle Expressions That Cannot Be Divided

This patch addresses the issue of SCEV division asserting on some
input expressions (e.g., non-affine expressions) and quietly giving
up on others.  When giving up, we set the quotient to be equal to
zero and the remainder to be equal to the numerator. With this
patch, we always quietly give up when we cannot perform the
division.

This patch also adds a test case for DependenceAnalysis that
previously caused an assertion.

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

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