summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-10-13 17:58:24 +0000
committerAndrew Trick <atrick@apple.com>2011-10-13 17:58:24 +0000
commit41c253c35cde8c9ca09954e1a7fc061afa4e326f (patch)
tree93caa1a756912c2ae5446804f71f2f4c1a30e1b9 /llvm/lib/Analysis
parent9423f99d688a0e6b320aa0138090631416c64474 (diff)
downloadbcm5719-llvm-41c253c35cde8c9ca09954e1a7fc061afa4e326f.tar.gz
bcm5719-llvm-41c253c35cde8c9ca09954e1a7fc061afa4e326f.zip
Revert r141870. The test case crashes on linux with data corruption. A deeper issue was exposed.
llvm-svn: 141873
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index e76b6b10cf9..81f4db1c7d2 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -1120,14 +1120,6 @@ Value *SCEVExpander::expandAddRecExprLiterally(const SCEVAddRecExpr *S) {
BasicBlock *LatchBlock = L->getLoopLatch();
assert(LatchBlock && "PostInc mode requires a unique loop latch!");
Result = PN->getIncomingValueForBlock(LatchBlock);
-
- // For an expansion to use the postinc form, the client must call
- // expandCodeFor with an InsertPoint that is either outside the PostIncLoop
- // or dominated by IVIncInsertPos.
- assert((!isa<Instruction>(Result) ||
- SE.DT->dominates(cast<Instruction>(Result),
- Builder.GetInsertPoint())) &&
- "postinc expansion does not dominate use");
}
// Re-apply any non-loop-dominating scale.
@@ -1418,12 +1410,8 @@ Value *SCEVExpander::expand(const SCEV *S) {
Value *V = visit(S);
// Remember the expanded value for this SCEV at this location.
- //
- // This is independent of PostIncLoops. The mapped value simply materializes
- // the expression at this insertion point. If the mapped value happened to be
- // a postinc expansion, it could be reused by a non postinc user, but only if
- // its insertion point was already at the head of the loop.
- InsertedExpressions[std::make_pair(S, InsertPt)] = V;
+ if (PostIncLoops.empty())
+ InsertedExpressions[std::make_pair(S, InsertPt)] = V;
restoreInsertPoint(SaveInsertBB, SaveInsertPt);
return V;
OpenPOWER on IntegriCloud