mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-05 01:31:05 +00:00
Loosen up these checks to allow direct uses of ESP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25595 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fb709b6817
commit
31e63881b3
@ -2903,13 +2903,21 @@ static SDOperand GetAdjustedArgumentStores(SDOperand Chain, int Offset,
|
||||
if (OrigDest.getOpcode() == ISD::CopyFromReg) {
|
||||
OrigOffset = 0;
|
||||
assert(cast<RegisterSDNode>(OrigDest.getOperand(1))->getReg() == X86::ESP);
|
||||
} else {
|
||||
} else if (OrigDest.getOpcode() == ISD::ADD &&
|
||||
isa<ConstantSDNode>(OrigDest.getOperand(1)) &&
|
||||
OrigDest.getOperand(0).getOpcode() == ISD::CopyFromReg &&
|
||||
cast<RegisterSDNode>(OrigDest.getOperand(0).getOperand(1))->getReg()
|
||||
== X86::ESP) {
|
||||
// We expect only (ESP+C)
|
||||
OrigOffset = cast<ConstantSDNode>(OrigDest.getOperand(1))->getValue();
|
||||
} else if (OrigDest.getOpcode() == ISD::Register) {
|
||||
// We expect only (ESP+C)
|
||||
OrigOffset = 0;
|
||||
} else {
|
||||
assert(OrigDest.getOpcode() == ISD::ADD &&
|
||||
isa<ConstantSDNode>(OrigDest.getOperand(1)) &&
|
||||
OrigDest.getOperand(0).getOpcode() == ISD::CopyFromReg &&
|
||||
cast<RegisterSDNode>(OrigDest.getOperand(0).getOperand(1))->getReg()
|
||||
== X86::ESP);
|
||||
OrigDest.getOperand(0).getOpcode() == ISD::Register &&
|
||||
cast<RegisterSDNode>(OrigDest.getOperand(0))->getReg() == X86::ESP);
|
||||
OrigOffset = cast<ConstantSDNode>(OrigDest.getOperand(1))->getValue();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user