diff options
author | Davide Italiano <davide@freebsd.org> | 2017-04-16 21:07:04 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2017-04-16 21:07:04 +0000 |
commit | dd37c67d812e0770e0f82b7541b2af439cb9baca (patch) | |
tree | 51da76fd63f38329453c924ec6100973570c46b2 /llvm/lib/Transforms/Utils/LCSSA.cpp | |
parent | 0d304f01b4d7839de2d9508d444c348654ed3ee4 (diff) | |
download | bcm5719-llvm-dd37c67d812e0770e0f82b7541b2af439cb9baca.tar.gz bcm5719-llvm-dd37c67d812e0770e0f82b7541b2af439cb9baca.zip |
[LCSSA] Fix non-determinism due to iterating over a SmallPtrSet.
Use a SmallSetVector instead.
llvm-svn: 300431
Diffstat (limited to 'llvm/lib/Transforms/Utils/LCSSA.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LCSSA.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/LCSSA.cpp b/llvm/lib/Transforms/Utils/LCSSA.cpp index 49b4bd92faf..d2bf2062555 100644 --- a/llvm/lib/Transforms/Utils/LCSSA.cpp +++ b/llvm/lib/Transforms/Utils/LCSSA.cpp @@ -241,7 +241,7 @@ bool llvm::formLCSSAForInstructions(SmallVectorImpl<Instruction *> &Worklist, // Compute the set of BasicBlocks in the loop `L` dominating at least one exit. static void computeBlocksDominatingExits( Loop &L, DominatorTree &DT, SmallVector<BasicBlock *, 8> &ExitBlocks, - SmallPtrSet<BasicBlock *, 8> &BlocksDominatingExits) { + SmallSetVector<BasicBlock *, 8> &BlocksDominatingExits) { SmallVector<BasicBlock *, 8> BBWorklist; // We start from the exit blocks, as every block trivially dominates itself @@ -279,7 +279,7 @@ static void computeBlocksDominatingExits( if (!L.contains(IDomBB)) continue; - if (BlocksDominatingExits.insert(IDomBB).second) + if (BlocksDominatingExits.insert(IDomBB)) BBWorklist.push_back(IDomBB); } } @@ -293,7 +293,7 @@ bool llvm::formLCSSA(Loop &L, DominatorTree &DT, LoopInfo *LI, if (ExitBlocks.empty()) return false; - SmallPtrSet<BasicBlock *, 8> BlocksDominatingExits; + SmallSetVector<BasicBlock *, 8> BlocksDominatingExits; // We want to avoid use-scanning leveraging dominance informations. // If a block doesn't dominate any of the loop exits, the none of the values |