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

@@ -54,7 +54,7 @@ typedef llvm::DenseMap<DomTreeNode *, unsigned> DomTreeLevelMap;
/// Promotes a single AllocStackInst into registers..
class StackAllocationPromoter {
typedef llvm::DenseSet<SILBasicBlock *> BlockSet;
typedef llvm::SmallSetVector<SILBasicBlock *, 16> BlockSet;
typedef llvm::DenseMap<SILBasicBlock *, SILInstruction *> BlockToInstMap;
// Use a priority queue keyed on dominator tree level so that inserted nodes
@@ -794,7 +794,7 @@ void StackAllocationPromoter::promoteAllocationToPhi() {
// The successor node is a new PHINode. If this is a new PHI node
// then it may require additional definitions, so add it to the PQ.
if (PhiBlocks.insert(Succ).second)
if (PhiBlocks.insert(Succ))
PQ.push(std::make_pair(SuccNode, SuccLevel));
}