summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMandeep Singh Grang <mgrang@codeaurora.org>2016-10-19 17:56:49 +0000
committerMandeep Singh Grang <mgrang@codeaurora.org>2016-10-19 17:56:49 +0000
commit5b1abfc88ec2d30801ac212b75ac1dfbcc195886 (patch)
tree988031fa0e8d7e0e941cf596c2660db0a15ae51a
parent6fd94bf47c9d43ae159f775f483b91ad8b995ffb (diff)
downloadbcm5719-llvm-5b1abfc88ec2d30801ac212b75ac1dfbcc195886.tar.gz
bcm5719-llvm-5b1abfc88ec2d30801ac212b75ac1dfbcc195886.zip
[polly] Fix non-determinism in polly BlockGenerators
Summary: Iterating over SeenBlocks which is a SmallPtrSet results in non-determinism in codegen Reviewers: jdoerfert, zinob, grosser Tags: #polly Differential Revision: https://reviews.llvm.org/D25778 llvm-svn: 284622
-rw-r--r--polly/lib/CodeGen/BlockGenerators.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp
index 893cb152ad6..835f2c5953e 100644
--- a/polly/lib/CodeGen/BlockGenerators.cpp
+++ b/polly/lib/CodeGen/BlockGenerators.cpp
@@ -1193,7 +1193,7 @@ void RegionGenerator::copyStmt(ScopStmt &Stmt, LoopToScevMapT &LTS,
// Iterate over all blocks in the region in a breadth-first search.
std::deque<BasicBlock *> Blocks;
- SmallPtrSet<BasicBlock *, 8> SeenBlocks;
+ SmallSetVector<BasicBlock *, 8> SeenBlocks;
Blocks.push_back(EntryBB);
SeenBlocks.insert(EntryBB);
@@ -1232,7 +1232,7 @@ void RegionGenerator::copyStmt(ScopStmt &Stmt, LoopToScevMapT &LTS,
// And continue with new successors inside the region.
for (auto SI = succ_begin(BB), SE = succ_end(BB); SI != SE; SI++)
- if (R->contains(*SI) && SeenBlocks.insert(*SI).second)
+ if (R->contains(*SI) && SeenBlocks.insert(*SI))
Blocks.push_back(*SI);
// Remember value in case it is visible after this subregion.
OpenPOWER on IntegriCloud