From ddeab10144cfa3831a44e62f0945979d134c4ee1 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Mon, 22 Oct 2007 03:03:20 +0000 Subject: [PATCH] Fix an unfolding bug. llvm-svn: 43212 --- lib/Target/X86/X86RegisterInfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index c78db16a42e..72e0fe44b30 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -1224,7 +1224,8 @@ bool X86RegisterInfo::unfoldMemoryOperand(MachineFunction &MF, MachineInstr *MI, MIB.addReg(Reg, true); for (unsigned i = 0, e = BeforeOps.size(); i != e; ++i) MIB = X86InstrAddOperand(MIB, BeforeOps[i]); - MIB.addReg(Reg); + if (FoldedLoad) + MIB.addReg(Reg); for (unsigned i = 0, e = AfterOps.size(); i != e; ++i) MIB = X86InstrAddOperand(MIB, AfterOps[i]); for (unsigned i = 0, e = ImpOps.size(); i != e; ++i) {