aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/ScalarEvolutionExpander.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-06-05 00:33:07 +0000
committerDan Gohman <gohman@apple.com>2010-06-05 00:33:07 +0000
commit25fcaff409f5c4c6da08f148ffb9404a71e8e4a7 (patch)
tree8112887ebc51a77665435311292ab4e21b9125d5 /include/llvm/Analysis/ScalarEvolutionExpander.h
parent88004c25c795dae031d22e5560cc4a0f98594e7c (diff)
downloadexternal_llvm-25fcaff409f5c4c6da08f148ffb9404a71e8e4a7.zip
external_llvm-25fcaff409f5c4c6da08f148ffb9404a71e8e4a7.tar.gz
external_llvm-25fcaff409f5c4c6da08f148ffb9404a71e8e4a7.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolutionExpander.h')
-rw-r--r--include/llvm/Analysis/ScalarEvolutionExpander.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h
index baf6946..656219d 100644
--- a/include/llvm/Analysis/ScalarEvolutionExpander.h
+++ b/include/llvm/Analysis/ScalarEvolutionExpander.h
@@ -32,6 +32,7 @@ namespace llvm {
std::map<std::pair<const SCEV *, Instruction *>, AssertingVH<Value> >
InsertedExpressions;
std::set<Value*> InsertedValues;
+ std::set<Value*> InsertedPostIncValues;
/// PostIncLoops - Addrecs referring to any of the given loops are expanded
/// in post-inc mode. For example, expanding {1,+,1}<L> in post-inc mode
@@ -102,6 +103,10 @@ namespace llvm {
/// clearPostInc - Disable all post-inc expansion.
void clearPostInc() {
PostIncLoops.clear();
+
+ // When we change the post-inc loop set, cached expansions may no
+ // longer be valid.
+ InsertedPostIncValues.clear();
}
/// disableCanonicalMode - Disable the behavior of expanding expressions in
@@ -146,7 +151,7 @@ namespace llvm {
/// inserted by the code rewriter. If so, the client should not modify the
/// instruction.
bool isInsertedInstruction(Instruction *I) const {
- return InsertedValues.count(I);
+ return InsertedValues.count(I) || InsertedPostIncValues.count(I);
}
Value *visitConstant(const SCEVConstant *S) {