Skip to content

Commit c833746

Browse files
authored
[DSE] Make iter order deterministic in removePartiallyOverlappedStores. NFC (#127678)
In removePartiallyOverlappedStores we iterate over InstOverlapIntervalsTy which is a DenseMap. Change that map into using MapVector to ensure that we apply the transforms in a deterministic order. I've only seen that the order matters if starting to use names for the instructions created when doing the transforms. But such things are a bit annoying when debugging etc.
1 parent 84eacd3 commit c833746

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static cl::opt<bool> EnableInitializesImprovement(
174174
// Helper functions
175175
//===----------------------------------------------------------------------===//
176176
using OverlapIntervalsTy = std::map<int64_t, int64_t>;
177-
using InstOverlapIntervalsTy = DenseMap<Instruction *, OverlapIntervalsTy>;
177+
using InstOverlapIntervalsTy = MapVector<Instruction *, OverlapIntervalsTy>;
178178

179179
/// Returns true if the end of this instruction can be safely shortened in
180180
/// length.

0 commit comments

Comments
 (0)