From bbfb6aca92e71f58deb7307dec7748a7c754c598 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Sat, 5 Jun 2010 00:33:07 +0000 Subject: LSR needs to remember inserted instructions even in postinc mode, because there could be multiple subexpressions within a single expansion which require insert point adjustment. This fixes PR7306. llvm-svn: 105510 --- llvm/lib/Analysis/ScalarEvolutionExpander.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp') diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp index 0012b84e1f0..4f49bf17fb4 100644 --- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp @@ -1312,7 +1312,9 @@ Value *SCEVExpander::expand(const SCEV *S) { } void SCEVExpander::rememberInstruction(Value *I) { - if (PostIncLoops.empty()) + if (!PostIncLoops.empty()) + InsertedPostIncValues.insert(I); + else InsertedValues.insert(I); // If we just claimed an existing instruction and that instruction had -- cgit v1.2.3