[polly] r284622 - [polly] Fix non-determinism in polly BlockGenerators
Mandeep Singh Grang via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 19 10:56:49 PDT 2016
Author: mgrang
Date: Wed Oct 19 12:56:49 2016
New Revision: 284622
URL: http://llvm.org/viewvc/llvm-project?rev=284622&view=rev
Log:
[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
Modified:
polly/trunk/lib/CodeGen/BlockGenerators.cpp
Modified: polly/trunk/lib/CodeGen/BlockGenerators.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/BlockGenerators.cpp?rev=284622&r1=284621&r2=284622&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/BlockGenerators.cpp (original)
+++ polly/trunk/lib/CodeGen/BlockGenerators.cpp Wed Oct 19 12:56:49 2016
@@ -1193,7 +1193,7 @@ void RegionGenerator::copyStmt(ScopStmt
// 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
// 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.
More information about the llvm-commits
mailing list