[ScalarEvolutionExpander] Reuse findExistingExpansion during expansion cost calculati...
authorIgor Laevsky <igmyrj@gmail.com>
Mon, 17 Aug 2015 16:37:04 +0000 (16:37 +0000)
committerIgor Laevsky <igmyrj@gmail.com>
Mon, 17 Aug 2015 16:37:04 +0000 (16:37 +0000)
commitdcf748827b3d1b243cf36a62efc763ebd9d5ca44
tree3b6eeac603afa05dcdfcafea004b616d35c0139a
parent1127a30ffed10b2434dc44abb51c21847ab6f8fd
[ScalarEvolutionExpander] Reuse findExistingExpansion during expansion cost calculation for division

Primary purpose of this change is to reuse existing code inside findExistingExpansion. However it introduces very slight semantic change - findExistingExpansion now looks into exiting blocks instead of a loop latches. Originally heuristic was based on the fact that we want to look at the loop exit conditions. And since all exiting latches will be listed in the ExitingBlocks, heuristic stays roughly the same.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245227 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolutionExpander.cpp