[SCEV] Update interface to handle SCEVExpander insert point motion.
authorGeoff Berry <gberry@codeaurora.org>
Thu, 11 Aug 2016 21:05:17 +0000 (21:05 +0000)
committerGeoff Berry <gberry@codeaurora.org>
Thu, 11 Aug 2016 21:05:17 +0000 (21:05 +0000)
commitd01828096f1660ae3641d2a345fe0b026acda2c9
tree4a14f2ea454373775305a2785ae1725d9034d04a
parentcb7d83c048c2ef7ce25bd4eb6bb9197ab6533cc4
[SCEV] Update interface to handle SCEVExpander insert point motion.

Summary:
This is an extension of the fix in r271424.  That fix dealt with builder
insert points being moved by SCEV expansion, but only for the lifetime
of the expand call.  This change modifies the interface so that LSR can
safely call expand multiple times at the same insert point and do the
right thing if one of the expansions decides to move the original insert
point.

This is a fix for PR28719.

Reviewers: sanjoy

Subscribers: llvm-commits, mcrosier, mzolotukhin

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

llvm-svn: 278413
llvm/include/llvm/Analysis/ScalarEvolutionExpander.h
llvm/lib/Analysis/ScalarEvolutionExpander.cpp
llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
llvm/test/Transforms/LoopStrengthReduce/X86/pr28719.ll [new file with mode: 0644]