[SCEV] Reduce the number of invocation to non trivial getExact function
authorSerguei Katkov <serguei.katkov@azul.com>
Sat, 28 Apr 2018 03:53:36 +0000 (03:53 +0000)
committerSerguei Katkov <serguei.katkov@azul.com>
Sat, 28 Apr 2018 03:53:36 +0000 (03:53 +0000)
commit6c6b40b3306ab7e8fc7246653b8c95caed4f8607
treec0f816e36e8ce42c70c121ed3b35c168704c4c80
parente7e8772446c3a748039507aa306215d3a910c964
[SCEV] Reduce the number of invocation to non trivial getExact function

The invocation of getExact in ScalarEvolution::getBackedgeTakenInfo is used
only for getting statistic and for assert.
Even if statistics is disabled, the code related to it will be eliminated
the invocation to getExact itself will not be eliminated
because it may have side-effects like creation of new SCEVs.

So do invocation only when we collect statistics or executes asserts.

Reviewers: mkazantsev, sanjoy, javed.absar
Reviewed By: javed.absar
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D46178

llvm-svn: 331099
llvm/lib/Analysis/ScalarEvolution.cpp