SIL optimizer: fix two non-deterministic behaviors

The problem was again iterating over pointer sets. This produced non-deterministic use list orderings, which does result in non-deterministic code generation itself.
But somehow debug info generation depends on the use list ordering (which should be investigated why).
And the non-deterministic debug info changes triggered re-running of the llvm pipeline.
This commit is contained in:
Erik Eckstein
2018-08-16 10:23:46 -07:00
parent 70bdea4ba4
commit 1f2629fd88
2 changed files with 5 additions and 3 deletions

View File

@@ -2530,7 +2530,9 @@ static void removeArgument(SILBasicBlock *BB, unsigned i) {
// Determine the set of predecessors in case any predecessor has
// two edges to this block (e.g. a conditional branch where both
// sides reach this block).
llvm::SmallPtrSet<SILBasicBlock *, 4> PredBBs;
llvm::SetVector<SILBasicBlock *,SmallVector<SILBasicBlock *, 8>,
SmallPtrSet<SILBasicBlock *, 8>> PredBBs;
for (auto *Pred : BB->getPredecessorBlocks())
PredBBs.insert(Pred);