[CodeGen] Use MapVector instead of DenseMap.

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
This commit is contained in:
Michael Kruse 2016-08-05 16:45:51 +00:00
parent 67cb90ba95
commit fbde435517
2 changed files with 5 additions and 5 deletions

View File

@ -18,7 +18,7 @@
#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"
@ -57,8 +57,8 @@ public:
///
/// @see The EscapeMap member.
using EscapeUsersAllocaMapTy =
DenseMap<Instruction *,
std::pair<AssertingVH<Value>, EscapeUserVectorTy>>;
MapVector<Instruction *,
std::pair<AssertingVH<Value>, EscapeUserVectorTy>>;
///@}

View File

@ -547,8 +547,8 @@ void BlockGenerator::createScalarFinalization(Scop &S) {
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;