[llvm-commits] CVS: llvm/lib/Target/X86/X86PeepholeOpt.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Jan 11 21:17:43 PST 2005
Changes in directory llvm/lib/Target/X86:
X86PeepholeOpt.cpp updated: 1.37 -> 1.38
---
Log message:
Do not lose the offset from teh global when peephole optimizing instructions.
This fixes FreeBench/pcompress
---
Diffs of the changes: (+3 -1)
Index: llvm/lib/Target/X86/X86PeepholeOpt.cpp
diff -u llvm/lib/Target/X86/X86PeepholeOpt.cpp:1.37 llvm/lib/Target/X86/X86PeepholeOpt.cpp:1.38
--- llvm/lib/Target/X86/X86PeepholeOpt.cpp:1.37 Tue Jan 11 16:58:43 2005
+++ llvm/lib/Target/X86/X86PeepholeOpt.cpp Tue Jan 11 23:17:28 2005
@@ -198,9 +198,11 @@
addReg(R1).addSImm(Offset).addZImm((char)Val));
} else if (MI->getOperand(3).isGlobalAddress()) {
GlobalValue *GA = MI->getOperand(3).getGlobal();
+ int Offset = MI->getOperand(3).getOffset();
I = MBB.insert(MBB.erase(I),
BuildMI(Opcode, 5).addReg(R0).addZImm(Scale).
- addReg(R1).addGlobalAddress(GA).addZImm((char)Val));
+ addReg(R1).addGlobalAddress(GA, false, Offset).
+ addZImm((char)Val));
}
return true;
}
More information about the llvm-commits
mailing list