[PATCH] D70783: AMDGPU: Fixed indeterminate map iteration in SIPeepholeSDWA

Tim Renouf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 27 07:22:32 PST 2019


tpr created this revision.
Herald added subscribers: llvm-commits, hiraditya, t-tye, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl, arsenm.
Herald added a project: LLVM.

Change-Id: Ic26f915a4acb4c00ecefa9d09d7c24cec370ed06


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70783

Files:
  llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp


Index: llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
+++ llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
@@ -28,6 +28,7 @@
 #include "Utils/AMDGPUBaseInfo.h"
 #include "llvm/ADT/None.h"
 #include "llvm/ADT/Optional.h"
+#include "llvm/ADT/MapVector.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/Statistic.h"
@@ -73,8 +74,8 @@
   const SIRegisterInfo *TRI;
   const SIInstrInfo *TII;
 
-  std::unordered_map<MachineInstr *, std::unique_ptr<SDWAOperand>> SDWAOperands;
-  std::unordered_map<MachineInstr *, SDWAOperandsVector> PotentialMatches;
+  MapVector<MachineInstr *, std::unique_ptr<SDWAOperand>> SDWAOperands;
+  MapVector<MachineInstr *, SDWAOperandsVector> PotentialMatches;
   SmallVector<MachineInstr *, 8> ConvertedInstructions;
 
   Optional<int64_t> foldToImm(const MachineOperand &Op) const;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70783.231256.patch
Type: text/x-patch
Size: 954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191127/5f1aec70/attachment.bin>


More information about the llvm-commits mailing list