[llvm-branch-commits] [llvm-branch] r109516 - /llvm/branches/Apple/williamson/lib/Target/X86/X86InstrInfo.cpp
Daniel Dunbar
daniel at zuster.org
Tue Jul 27 10:49:51 PDT 2010
Author: ddunbar
Date: Tue Jul 27 12:49:50 2010
New Revision: 109516
URL: http://llvm.org/viewvc/llvm-project?rev=109516&view=rev
Log:
Merge r109489:
--
Author: Jakob Stoklund Olesen <stoklund at 2pi.dk>
Date: Tue Jul 27 04:17:01 2010 +0000
The isLoadFromStackSlot and isStoreToStackSlot have no way of reporting
subregister operands like this:
%reg1040:sub_32bit<def> = MOV32rm <fi#-2>, 1, %reg0, 0, %reg0, %reg1040<imp-def>; mem:LD4[FixedStack-2](align=8)
Make them return false when subreg operands are present. VirtRegRewriter is
making bad assumptions otherwise.
This fixes PR7713.
Modified:
llvm/branches/Apple/williamson/lib/Target/X86/X86InstrInfo.cpp
Modified: llvm/branches/Apple/williamson/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/williamson/lib/Target/X86/X86InstrInfo.cpp?rev=109516&r1=109515&r2=109516&view=diff
==============================================================================
--- llvm/branches/Apple/williamson/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/branches/Apple/williamson/lib/Target/X86/X86InstrInfo.cpp Tue Jul 27 12:49:50 2010
@@ -787,7 +787,7 @@
unsigned X86InstrInfo::isLoadFromStackSlot(const MachineInstr *MI,
int &FrameIndex) const {
if (isFrameLoadOpcode(MI->getOpcode()))
- if (isFrameOperand(MI, 1, FrameIndex))
+ if (MI->getOperand(0).getSubReg() == 0 && isFrameOperand(MI, 1, FrameIndex))
return MI->getOperand(0).getReg();
return 0;
}
@@ -826,7 +826,8 @@
unsigned X86InstrInfo::isStoreToStackSlot(const MachineInstr *MI,
int &FrameIndex) const {
if (isFrameStoreOpcode(MI->getOpcode()))
- if (isFrameOperand(MI, 0, FrameIndex))
+ if (MI->getOperand(X86::AddrNumOperands).getSubReg() == 0 &&
+ isFrameOperand(MI, 0, FrameIndex))
return MI->getOperand(X86::AddrNumOperands).getReg();
return 0;
}
More information about the llvm-branch-commits
mailing list