[AMDGPU] Fixed asan error after D61536

llvm-svn: 359963
diff --git a/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp b/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
index adae968..c2af348 100644
--- a/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
@@ -858,7 +858,7 @@
   const SIRegisterInfo *TRI = ST.getRegisterInfo();
   const MachineOperand *SDST = TII->getNamedOperand(*MI, SDSTName);
   if (!SDST) {
-    for (auto MO : MI->implicit_operands()) {
+    for (const auto &MO : MI->implicit_operands()) {
       if (MO.isDef() && TRI->isSGPRClass(TRI->getPhysRegClass(MO.getReg()))) {
         SDST = &MO;
         break;