[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.

llvm-svn: 280342
This commit is contained in:
James Molloy 2016-09-01 09:01:34 +00:00
parent 77564f92e8
commit 21744689b9
1 changed files with 2 additions and 2 deletions

View File

@ -176,7 +176,7 @@ public:
/// terminator instructions together.
static bool
SafeToMergeTerminators(TerminatorInst *SI1, TerminatorInst *SI2,
SmallPtrSetImpl<BasicBlock *> *FailBlocks = nullptr) {
SmallSetVector<BasicBlock *, 4> *FailBlocks = nullptr) {
if (SI1 == SI2)
return false; // Can't merge with self!
@ -961,7 +961,7 @@ bool SimplifyCFGOpt::FoldValueComparisonIntoPredecessors(TerminatorInst *TI,
Value *PCV = isValueEqualityComparison(PTI); // PredCondVal
if (PCV == CV && TI != PTI) {
SmallPtrSet<BasicBlock*, 4> FailBlocks;
SmallSetVector<BasicBlock*, 4> FailBlocks;
if (!SafeToMergeTerminators(TI, PTI, &FailBlocks)) {
for (auto *Succ : FailBlocks) {
std::vector<BasicBlock*> Blocks = { TI->getParent() };