[llvm] 3d5ba7c - AMDGPU: Fixed indeterminate map iteration in SIPeepholeSDWA

Tim Renouf via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 04:11:17 PST 2019


Author: Tim Renouf
Date: 2019-12-02T12:08:49Z
New Revision: 3d5ba7c60f393096ab07880c65032d4b94880bc6

URL: https://github.com/llvm/llvm-project/commit/3d5ba7c60f393096ab07880c65032d4b94880bc6
DIFF: https://github.com/llvm/llvm-project/commit/3d5ba7c60f393096ab07880c65032d4b94880bc6.diff

LOG: AMDGPU: Fixed indeterminate map iteration in SIPeepholeSDWA

Differential Revision: https://reviews.llvm.org/D70783

Change-Id: Ic26f915a4acb4c00ecefa9d09d7c24cec370ed06

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp b/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
index 9b3b2436475c..05c81feb23ec 100644
--- a/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
+++ b/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
@@ -26,6 +26,7 @@
 #include "SIRegisterInfo.h"
 #include "MCTargetDesc/AMDGPUMCTargetDesc.h"
 #include "Utils/AMDGPUBaseInfo.h"
+#include "llvm/ADT/MapVector.h"
 #include "llvm/ADT/None.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
@@ -73,8 +74,8 @@ class SIPeepholeSDWA : public MachineFunctionPass {
   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;


        


More information about the llvm-commits mailing list