Just noticed that when we generate a custom lowering for some atomics
that we forgot to transfer the MemOperand to the new instruction that
touches memory.
-- Mon Ping
Index: lib/Target/X86/X86ISelLowering.cpp
==================================================================---
lib/Target/X86/X86ISelLowering.cpp (revision 53702)
+++ lib/Target/X86/X86ISelLowering.cpp (working copy)
@@ -6010,7 +6010,9 @@
for (int i=0; i <= lastAddrIndx; ++i)
(*MIB).addOperand(*argOpers[i]);
MIB.addReg(t2);
-
+ assert(bInstr->hasOneMemOperand() && "Unexpected number of
memoperand");
+ (*MIB).addMemOperand(*F, *bInstr->memoperands_begin());
+
MIB = BuildMI(newMBB, TII->get(X86::MOV32rr), destOper.getReg());
MIB.addReg(X86::EAX);
@@ -6107,6 +6109,8 @@
for (int i=0; i <= lastAddrIndx; ++i)
(*MIB).addOperand(*argOpers[i]);
MIB.addReg(t3);
+ assert(mInstr->hasOneMemOperand() && "Unexpected number of
memoperand");
+ (*MIB).addMemOperand(*F, *mInstr->memoperands_begin());
MIB = BuildMI(newMBB, TII->get(X86::MOV32rr), destOper.getReg());
MIB.addReg(X86::EAX);