Skip to content

Commit

Permalink
[DAGCombine] Fix non-deterministic debug output
Browse files Browse the repository at this point in the history
PR37970 reported non-deterministic debug output, this was caused by
iterating through a set and not a a vector.

bugzilla: https://bugs.llvm.org/show_bug.cgi?id=37970

Differential Revision: https://reviews.llvm.org/D54570

llvm-svn: 347037
  • Loading branch information
sparker-arm committed Nov 16, 2018
1 parent 98ae975 commit ab99cfa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Expand Up @@ -528,7 +528,7 @@ namespace {
EVT &MemVT, unsigned ShAmt = 0);

/// Used by BackwardsPropagateMask to find suitable loads.
bool SearchForAndLoads(SDNode *N, SmallPtrSetImpl<LoadSDNode*> &Loads,
bool SearchForAndLoads(SDNode *N, SmallVectorImpl<LoadSDNode*> &Loads,
SmallPtrSetImpl<SDNode*> &NodesWithConsts,
ConstantSDNode *Mask, SDNode *&NodeToMask);
/// Attempt to propagate a given AND node back to load leaves so that they
Expand Down Expand Up @@ -4213,7 +4213,7 @@ bool DAGCombiner::isLegalNarrowLdSt(LSBaseSDNode *LDST,
}

bool DAGCombiner::SearchForAndLoads(SDNode *N,
SmallPtrSetImpl<LoadSDNode*> &Loads,
SmallVectorImpl<LoadSDNode*> &Loads,
SmallPtrSetImpl<SDNode*> &NodesWithConsts,
ConstantSDNode *Mask,
SDNode *&NodeToMask) {
Expand Down Expand Up @@ -4250,7 +4250,7 @@ bool DAGCombiner::SearchForAndLoads(SDNode *N,

// Use LE to convert equal sized loads to zext.
if (ExtVT.bitsLE(Load->getMemoryVT()))
Loads.insert(Load);
Loads.push_back(Load);

continue;
}
Expand Down Expand Up @@ -4315,7 +4315,7 @@ bool DAGCombiner::BackwardsPropagateMask(SDNode *N, SelectionDAG &DAG) {
if (isa<LoadSDNode>(N->getOperand(0)))
return false;

SmallPtrSet<LoadSDNode*, 8> Loads;
SmallVector<LoadSDNode*, 8> Loads;
SmallPtrSet<SDNode*, 2> NodesWithConsts;
SDNode *FixupNode = nullptr;
if (SearchForAndLoads(N, Loads, NodesWithConsts, Mask, FixupNode)) {
Expand Down

0 comments on commit ab99cfa

Please sign in to comment.