Fix frame index code to generate legal PowerPC instructions. About half of

Shootout now works.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20940 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nate Begeman 2005-03-30 02:23:08 +00:00
parent 01d05266f9
commit 58f718cd97

View File

@ -612,9 +612,8 @@ unsigned ISel::SelectExprFP(SDOperand N, unsigned Result)
} }
if(Address.getOpcode() == ISD::FrameIndex) { if(Address.getOpcode() == ISD::FrameIndex) {
BuildMI(BB, Opc, 2, Result) Tmp1 = cast<FrameIndexSDNode>(Address)->getIndex();
.addFrameIndex(cast<FrameIndexSDNode>(Address)->getIndex()) addFrameReference(BuildMI(BB, Opc, 2, Result), (int)Tmp1);
.addReg(PPC::R1);
} else { } else {
int offset; int offset;
SelectAddr(Address, Tmp1, offset); SelectAddr(Address, Tmp1, offset);
@ -730,7 +729,7 @@ unsigned ISel::SelectExpr(SDOperand N) {
case ISD::FrameIndex: case ISD::FrameIndex:
Tmp1 = cast<FrameIndexSDNode>(N)->getIndex(); Tmp1 = cast<FrameIndexSDNode>(N)->getIndex();
addFrameReference(BuildMI(BB, PPC::ADDI, 2, Result), (int)Tmp1); addFrameReference(BuildMI(BB, PPC::ADDI, 2, Result), (int)Tmp1, 0, false);
return Result; return Result;
case ISD::GlobalAddress: { case ISD::GlobalAddress: {
@ -782,9 +781,8 @@ unsigned ISel::SelectExpr(SDOperand N) {
Tmp3 = 0; // Silence GCC warning. Tmp3 = 0; // Silence GCC warning.
} }
if(Address.getOpcode() == ISD::FrameIndex) { if(Address.getOpcode() == ISD::FrameIndex) {
BuildMI(BB, Opc, 2, Result) Tmp1 = cast<FrameIndexSDNode>(Address)->getIndex();
.addFrameIndex(cast<FrameIndexSDNode>(Address)->getIndex()) addFrameReference(BuildMI(BB, Opc, 2, Result), (int)Tmp1);
.addReg(PPC::R1);
} else { } else {
int offset; int offset;
SelectAddr(Address, Tmp1, offset); SelectAddr(Address, Tmp1, offset);
@ -1343,8 +1341,8 @@ void ISel::Select(SDOperand N) {
} }
else if(Address.getOpcode() == ISD::FrameIndex) else if(Address.getOpcode() == ISD::FrameIndex)
{ {
BuildMI(BB, Opc, 2).addReg(Tmp1) Tmp2 = cast<FrameIndexSDNode>(Address)->getIndex();
.addFrameIndex(cast<FrameIndexSDNode>(Address)->getIndex()); addFrameReference(BuildMI(BB, Opc, 3).addReg(Tmp1), (int)Tmp2);
} }
else else
{ {