mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-04 11:17:31 +00:00
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. llvm-svn: 109489
This commit is contained in:
parent
fa4bcde9d9
commit
b056152ccf
@ -787,7 +787,7 @@ static bool isFrameStoreOpcode(int Opcode) {
|
||||
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 @@ bool X86InstrInfo::hasLoadFromStackSlot(const MachineInstr *MI,
|
||||
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user