summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-03-30 02:23:08 +0000
committerNate Begeman <natebegeman@mac.com>2005-03-30 02:23:08 +0000
commita8114a0f48889cc6fdda42d3417f3a0fdeef6915 (patch)
treeec63a0c0a764071c9f1f46f08414814b61833e39 /llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
parent5851a661280d20e8f25b6a9d9cac701cd999cdad (diff)
downloadbcm5719-llvm-a8114a0f48889cc6fdda42d3417f3a0fdeef6915.tar.gz
bcm5719-llvm-a8114a0f48889cc6fdda42d3417f3a0fdeef6915.zip
Fix frame index code to generate legal PowerPC instructions. About half of
Shootout now works. llvm-svn: 20940
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp b/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
index 451ff031c6b..afeaac96c7f 100644
--- a/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
+++ b/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
@@ -612,9 +612,8 @@ unsigned ISel::SelectExprFP(SDOperand N, unsigned Result)
}
if(Address.getOpcode() == ISD::FrameIndex) {
- BuildMI(BB, Opc, 2, Result)
- .addFrameIndex(cast<FrameIndexSDNode>(Address)->getIndex())
- .addReg(PPC::R1);
+ Tmp1 = cast<FrameIndexSDNode>(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<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;
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<FrameIndexSDNode>(Address)->getIndex())
- .addReg(PPC::R1);
+ Tmp1 = cast<FrameIndexSDNode>(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<FrameIndexSDNode>(Address)->getIndex());
+ Tmp2 = cast<FrameIndexSDNode>(Address)->getIndex();
+ addFrameReference(BuildMI(BB, Opc, 3).addReg(Tmp1), (int)Tmp2);
}
else
{
OpenPOWER on IntegriCloud