mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-28 14:27:08 +00:00
[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:
parent
67cb90ba95
commit
fbde435517
@ -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>>;
|
||||
|
||||
///@}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user