[X86] Preserve mem refs on newly created 'Store' node instead of 'Load' node when...
authorCraig Topper <craig.topper@gmail.com>
Tue, 10 Feb 2015 06:29:28 +0000 (06:29 +0000)
committerCraig Topper <craig.topper@gmail.com>
Tue, 10 Feb 2015 06:29:28 +0000 (06:29 +0000)
Bug spotted by Steve King.

I have no idea how to test this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228672 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrInfo.cpp

index a5d3d27..6f8405c 100644 (file)
@@ -5335,7 +5335,7 @@ X86InstrInfo::unfoldMemoryOperand(SelectionDAG &DAG, SDNode *N,
     NewNodes.push_back(Store);
 
     // Preserve memory reference information.
     NewNodes.push_back(Store);
 
     // Preserve memory reference information.
-    cast<MachineSDNode>(Load)->setMemRefs(MMOs.first, MMOs.second);
+    cast<MachineSDNode>(Store)->setMemRefs(MMOs.first, MMOs.second);
   }
 
   return true;
   }
 
   return true;