diff options
| author | Mandeep Singh Grang <mgrang@codeaurora.org> | 2016-10-19 17:56:49 +0000 |
|---|---|---|
| committer | Mandeep Singh Grang <mgrang@codeaurora.org> | 2016-10-19 17:56:49 +0000 |
| commit | 5b1abfc88ec2d30801ac212b75ac1dfbcc195886 (patch) | |
| tree | 988031fa0e8d7e0e941cf596c2660db0a15ae51a /polly/lib/CodeGen/BlockGenerators.cpp | |
| parent | 6fd94bf47c9d43ae159f775f483b91ad8b995ffb (diff) | |
[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
Diffstat (limited to 'polly/lib/CodeGen/BlockGenerators.cpp')
| -rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index 893cb152ad6a..835f2c5953e3 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -1193,7 +1193,7 @@ void RegionGenerator::copyStmt(ScopStmt &Stmt, LoopToScevMapT <S, // 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 <S, // 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. |
