Fix PR2434. When scanning for exising binary operator to reuse don't
authorWojciech Matyjewicz <wmatyjewicz@fastmail.fm>
Sun, 15 Jun 2008 19:07:39 +0000 (19:07 +0000)
committerWojciech Matyjewicz <wmatyjewicz@fastmail.fm>
Sun, 15 Jun 2008 19:07:39 +0000 (19:07 +0000)
commit8a08769bad43a22fae2845bb0ba0fd1266cd55c8
tree9abb039b6c4ffddfb82d5c4ad11145c2880bbbd7
parent93c534623c4691d255ea6c870347482ff8752313
Fix PR2434. When scanning for exising binary operator to reuse don't
take into account the instrucion pointed by InsertPt. Thanks to it,
returning the new value of InsertPt to the InsertBinop() caller can be
avoided. The bug was, actually, in visitAddRecExpr() method which wasn't
correctly handling changes of InsertPt. There shouldn't be any
performance regression, as -gvn pass (run after -indvars) removes any
redundant binops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52291 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ScalarEvolutionExpander.h
lib/Analysis/ScalarEvolutionExpander.cpp
test/Transforms/IndVarsSimplify/2008-06-15-SCEVExpanderBug.ll [new file with mode: 0644]