From 21744689b9b709e7de967b41bd6c1828aa7c005a Mon Sep 17 00:00:00 2001 From: James Molloy Date: Thu, 1 Sep 2016 09:01:34 +0000 Subject: [PATCH] [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 --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index d8f8851c72d9..67024bb5933f 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -176,7 +176,7 @@ public: /// terminator instructions together. static bool SafeToMergeTerminators(TerminatorInst *SI1, TerminatorInst *SI2, - SmallPtrSetImpl *FailBlocks = nullptr) { + SmallSetVector *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 FailBlocks; + SmallSetVector FailBlocks; if (!SafeToMergeTerminators(TI, PTI, &FailBlocks)) { for (auto *Succ : FailBlocks) { std::vector Blocks = { TI->getParent() };