From: Nate Begeman Date: Wed, 30 Mar 2005 02:23:08 +0000 (+0000) Subject: Fix frame index code to generate legal PowerPC instructions. About half of X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=58f718cd97b0b2e267d60c520a00431f29408417;p=oota-llvm.git 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 --- diff --git a/lib/Target/PowerPC/PPCISelPattern.cpp b/lib/Target/PowerPC/PPCISelPattern.cpp index 451ff031c6b..afeaac96c7f 100644 --- a/lib/Target/PowerPC/PPCISelPattern.cpp +++ b/lib/Target/PowerPC/PPCISelPattern.cpp @@ -612,9 +612,8 @@ unsigned ISel::SelectExprFP(SDOperand N, unsigned Result) } if(Address.getOpcode() == ISD::FrameIndex) { - BuildMI(BB, Opc, 2, Result) - .addFrameIndex(cast(Address)->getIndex()) - .addReg(PPC::R1); + Tmp1 = cast(Address)->getIndex(); + addFrameReference(BuildMI(BB, Opc, 2, Result), (int)Tmp1); } else { int offset; SelectAddr(Address, Tmp1, offset); @@ -730,7 +729,7 @@ unsigned ISel::SelectExpr(SDOperand N) { case ISD::FrameIndex: Tmp1 = cast(N)->getIndex(); - addFrameReference(BuildMI(BB, PPC::ADDI, 2, Result), (int)Tmp1); + addFrameReference(BuildMI(BB, PPC::ADDI, 2, Result), (int)Tmp1, 0, false); return Result; case ISD::GlobalAddress: { @@ -782,9 +781,8 @@ unsigned ISel::SelectExpr(SDOperand N) { Tmp3 = 0; // Silence GCC warning. } if(Address.getOpcode() == ISD::FrameIndex) { - BuildMI(BB, Opc, 2, Result) - .addFrameIndex(cast(Address)->getIndex()) - .addReg(PPC::R1); + Tmp1 = cast(Address)->getIndex(); + addFrameReference(BuildMI(BB, Opc, 2, Result), (int)Tmp1); } else { int offset; SelectAddr(Address, Tmp1, offset); @@ -1343,8 +1341,8 @@ void ISel::Select(SDOperand N) { } else if(Address.getOpcode() == ISD::FrameIndex) { - BuildMI(BB, Opc, 2).addReg(Tmp1) - .addFrameIndex(cast(Address)->getIndex()); + Tmp2 = cast(Address)->getIndex(); + addFrameReference(BuildMI(BB, Opc, 3).addReg(Tmp1), (int)Tmp2); } else {