diff options
| author | Michael Kruse <llvm@meinersbur.de> | 2016-08-05 16:45:51 +0000 |
|---|---|---|
| committer | Michael Kruse <llvm@meinersbur.de> | 2016-08-05 16:45:51 +0000 |
| commit | fbde435517f8e2fc884423aa5b007ae4ea6af754 (patch) | |
| tree | e8af759ec5879fc4bae2d39a20929ec3224d4856 | |
| parent | 67cb90ba95b4fa03292eb0348f86b8d6642c1583 (diff) | |
| download | bcm5719-llvm-fbde435517f8e2fc884423aa5b007ae4ea6af754.tar.gz bcm5719-llvm-fbde435517f8e2fc884423aa5b007ae4ea6af754.zip | |
[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
| -rw-r--r-- | polly/include/polly/CodeGen/BlockGenerators.h | 6 | ||||
| -rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/polly/include/polly/CodeGen/BlockGenerators.h b/polly/include/polly/CodeGen/BlockGenerators.h index 92b62ea4934..20c4d9b8889 100644 --- a/polly/include/polly/CodeGen/BlockGenerators.h +++ b/polly/include/polly/CodeGen/BlockGenerators.h @@ -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>>; ///@} diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index 7c398eba460..1959cc286a7 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -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; |

