[llvm-commits] [llvm] r82597 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Dan Gohman
gohman at apple.com
Tue Sep 22 18:29:41 PDT 2009
Author: djg
Date: Tue Sep 22 20:29:41 2009
New Revision: 82597
URL: http://llvm.org/viewvc/llvm-project?rev=82597&view=rev
Log:
Fix X86's unfoldMemoryOperand to properly handle MachineMemOperands.
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=82597&r1=82596&r2=82597&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Tue Sep 22 20:29:41 2009
@@ -2567,7 +2567,7 @@
std::vector<SDValue> AfterOps;
DebugLoc dl = N->getDebugLoc();
unsigned NumOps = N->getNumOperands();
- for (unsigned i = 0; i != NumOps-1; ++i) {
+ for (unsigned i = 0; i != NumOps-2; ++i) {
SDValue Op = N->getOperand(i);
if (i >= Index-NumDefs && i < Index-NumDefs + X86AddrNumOperands)
AddrOps.push_back(Op);
@@ -2576,6 +2576,8 @@
else if (i > Index-NumDefs)
AfterOps.push_back(Op);
}
+ SDValue MemOp = N->getOperand(NumOps-2);
+ AddrOps.push_back(MemOp);
SDValue Chain = N->getOperand(NumOps-1);
AddrOps.push_back(Chain);
@@ -2613,7 +2615,9 @@
// Emit the store instruction.
if (FoldedStore) {
AddrOps.pop_back();
+ AddrOps.pop_back();
AddrOps.push_back(SDValue(NewNode, 0));
+ AddrOps.push_back(MemOp);
AddrOps.push_back(Chain);
bool isAligned = (RI.getStackAlignment() >= 16) ||
RI.needsStackRealignment(MF);
More information about the llvm-commits
mailing list