The map is iterated over when generating the values escaping the SCoP. The
indeterministic iteration order of DenseMap causes the output IR to change at
every compilation, adding noise to comparisons.
Replace DenseMap by a MapVector to ensure the same iteration order at every
compilation.
llvm-svn: 277832
#include "polly/CodeGen/IRBuilder.h"
#include "polly/Support/ScopHelper.h"
-#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/MapVector.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "isl/map.h"
///
/// @see The EscapeMap member.
using EscapeUsersAllocaMapTy =
- DenseMap<Instruction *,
- std::pair<AssertingVH<Value>, EscapeUserVectorTy>>;
+ MapVector<Instruction *,
+ std::pair<AssertingVH<Value>, EscapeUserVectorTy>>;
///@}
for (const auto &EscapeMapping : EscapeMap) {
// Extract the escaping instruction and the escaping users as well as the
// alloca the instruction was demoted to.
- Instruction *EscapeInst = EscapeMapping.getFirst();
- const auto &EscapeMappingValue = EscapeMapping.getSecond();
+ Instruction *EscapeInst = EscapeMapping.first;
+ const auto &EscapeMappingValue = EscapeMapping.second;
const EscapeUserVectorTy &EscapeUsers = EscapeMappingValue.second;
Value *ScalarAddr = EscapeMappingValue.first;