Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 16a76ce

Browse files
author
James Molloy
committed
[SimplifyCFG] Fix nondeterministic iteration order
We iterate over the result from SafeToMergeTerminators, so make it a SmallSetVector instead of a SmallPtrSet. Should fix stage3 convergence builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280342 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 5c88a87 commit 16a76ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class SimplifyCFGOpt {
176176
/// terminator instructions together.
177177
static bool
178178
SafeToMergeTerminators(TerminatorInst *SI1, TerminatorInst *SI2,
179-
SmallPtrSetImpl<BasicBlock *> *FailBlocks = nullptr) {
179+
SmallSetVector<BasicBlock *, 4> *FailBlocks = nullptr) {
180180
if (SI1 == SI2)
181181
return false; // Can't merge with self!
182182

@@ -961,7 +961,7 @@ bool SimplifyCFGOpt::FoldValueComparisonIntoPredecessors(TerminatorInst *TI,
961961
Value *PCV = isValueEqualityComparison(PTI); // PredCondVal
962962

963963
if (PCV == CV && TI != PTI) {
964-
SmallPtrSet<BasicBlock*, 4> FailBlocks;
964+
SmallSetVector<BasicBlock*, 4> FailBlocks;
965965
if (!SafeToMergeTerminators(TI, PTI, &FailBlocks)) {
966966
for (auto *Succ : FailBlocks) {
967967
std::vector<BasicBlock*> Blocks = { TI->getParent() };

0 commit comments

Comments
 (0)