]> granicus.if.org Git - llvm/commit
[SCEV] Return zero from computeConstantDifference(X, X)
authorNikolai Bozhenov <nikolai.bozhenov@intel.com>
Wed, 7 Aug 2019 17:38:38 +0000 (17:38 +0000)
committerNikolai Bozhenov <nikolai.bozhenov@intel.com>
Wed, 7 Aug 2019 17:38:38 +0000 (17:38 +0000)
commit318b6b52dc1080c2d87e9733ff8813bb9b9eed40
tree23e36a34310fd6c58a6eb0d97f14564df6da0d92
parent2e0aa49547051cf6d1fe6ef62538296704a8da9d
[SCEV] Return zero from computeConstantDifference(X, X)

Without this patch computeConstantDifference returns None for cases like
these:

  computeConstantDifference(%x, %x)
  computeConstantDifference({%x,+,16}, {%x,+,16})

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

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