summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2016-09-01 09:01:34 +0000
committerJames Molloy <james.molloy@arm.com>2016-09-01 09:01:34 +0000
commit21744689b9b709e7de967b41bd6c1828aa7c005a (patch)
treebf9e96d329eb895df22aca2c70f42001eba64133 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp
parent77564f92e89c5097b69129db080d574000fe8245 (diff)
downloadbcm5719-llvm-21744689b9b709e7de967b41bd6c1828aa7c005a.tar.gz
bcm5719-llvm-21744689b9b709e7de967b41bd6c1828aa7c005a.zip
[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
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index d8f8851c72d..67024bb5933 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<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() };
OpenPOWER on IntegriCloud