forked from OSchip/llvm-project
[PhiValues] Use SetVector to avoid non-determinism
I'm not sure whether this can cause actual non-determinism in the compiler output, but at least it causes non-determinism in the statistics collected by BasicAA. Use SetVector to have a predictable iteration order.
This commit is contained in:
parent
1253c40727
commit
dd887d97ce
|
@ -21,7 +21,7 @@
|
|||
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "llvm/ADT/DenseSet.h"
|
||||
#include "llvm/ADT/SmallPtrSet.h"
|
||||
#include "llvm/ADT/SetVector.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/IR/PassManager.h"
|
||||
#include "llvm/IR/ValueHandle.h"
|
||||
|
@ -40,7 +40,7 @@ class Function;
|
|||
/// it is queried.
|
||||
class PhiValues {
|
||||
public:
|
||||
using ValueSet = SmallPtrSet<Value *, 4>;
|
||||
using ValueSet = SmallSetVector<Value *, 4>;
|
||||
|
||||
/// Construct an empty PhiValues.
|
||||
PhiValues(const Function &F) : F(F) {}
|
||||
|
@ -70,8 +70,7 @@ public:
|
|||
FunctionAnalysisManager::Invalidator &);
|
||||
|
||||
private:
|
||||
using PhiSet = SmallPtrSet<const PHINode *, 4>;
|
||||
using ConstValueSet = SmallPtrSet<const Value *, 4>;
|
||||
using ConstValueSet = SmallSetVector<const Value *, 4>;
|
||||
|
||||
/// The next depth number to be used by processPhi.
|
||||
unsigned int NextDepthNumber = 1;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/Analysis/PhiValues.h"
|
||||
#include "llvm/ADT/SmallPtrSet.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/IR/Instructions.h"
|
||||
#include "llvm/InitializePasses.h"
|
||||
|
|
Loading…
Reference in New Issue