Skip to content

Commit e048e97

Browse files
yanoknikic
authored andcommitted
[RegAllocFast] Fix nondeterminism in debuginfo generation
Changes from commit 1db137b added iteration over hash map that can result in non-deterministic order. Fix that by using a SmallMapVector to preserve the order. Differential Revision: https://reviews.llvm.org/D113468 (cherry picked from commit 3c47c5c)
1 parent b51341b commit e048e97

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/CodeGen/RegAllocFast.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "llvm/ADT/ArrayRef.h"
1616
#include "llvm/ADT/DenseMap.h"
1717
#include "llvm/ADT/IndexedMap.h"
18+
#include "llvm/ADT/MapVector.h"
1819
#include "llvm/ADT/SmallSet.h"
1920
#include "llvm/ADT/SmallVector.h"
2021
#include "llvm/ADT/SparseSet.h"
@@ -432,7 +433,7 @@ void RegAllocFast::spill(MachineBasicBlock::iterator Before, Register VirtReg,
432433
// every definition of it, meaning we can switch all the DBG_VALUEs over
433434
// to just reference the stack slot.
434435
SmallVectorImpl<MachineOperand *> &LRIDbgOperands = LiveDbgValueMap[VirtReg];
435-
SmallDenseMap<MachineInstr *, SmallVector<const MachineOperand *>>
436+
SmallMapVector<MachineInstr *, SmallVector<const MachineOperand *>, 2>
436437
SpilledOperandsMap;
437438
for (MachineOperand *MO : LRIDbgOperands)
438439
SpilledOperandsMap[MO->getParent()].push_back(MO);

0 commit comments

Comments
 (0)