[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Aug 26 11:37:34 PDT 2005
Changes in directory llvm/lib/Target/PowerPC:
PPC32ISelDAGToDAG.cpp updated: 1.41 -> 1.42
---
Log message:
Changes to adjust to new ReplaceAllUsesWith syntax. Change FP_EXTEND to
just return its input, instead of emitting an explicit copy.
---
Diffs of the changes: (+15 -13)
PPC32ISelDAGToDAG.cpp | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
Index: llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp
diff -u llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp:1.41 llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp:1.42
--- llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp:1.41 Fri Aug 26 12:40:39 2005
+++ llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp Fri Aug 26 13:37:23 2005
@@ -654,7 +654,7 @@
}
if (New.Val != N) {
- CurDAG->ReplaceAllUsesWith(N, New.Val);
+ CurDAG->ReplaceAllUsesWith(Op, New);
N = New.Val;
}
break;
@@ -673,7 +673,7 @@
if (Chain != N->getOperand(0) || Val != N->getOperand(2)) {
SDOperand New = CurDAG->getNode(ISD::CopyToReg, MVT::Other,
Chain, Reg, Val);
- CurDAG->ReplaceAllUsesWith(N, New.Val);
+ CurDAG->ReplaceAllUsesWith(Op, New);
N = New.Val;
}
break;
@@ -752,7 +752,7 @@
if (Ty == MVT::i32) {
if (SDNode *I = SelectIntImmediateExpr(N->getOperand(0), N->getOperand(1),
PPC::ADDIS, PPC::ADDI, true)) {
- CurDAG->ReplaceAllUsesWith(N, I);
+ CurDAG->ReplaceAllUsesWith(Op, SDOperand(I, 0));
N = I;
} else {
CurDAG->SelectNodeTo(N, PPC::ADD, MVT::i32, Select(N->getOperand(0)),
@@ -799,7 +799,7 @@
}
if (SDNode *I = SelectIntImmediateExpr(N->getOperand(0), N->getOperand(1),
PPC::ADDIS, PPC::ADDI, true, true)) {
- CurDAG->ReplaceAllUsesWith(N, I);
+ CurDAG->ReplaceAllUsesWith(Op, SDOperand(I, 0));
N = I;
} else {
CurDAG->SelectNodeTo(N, PPC::SUBF, Ty, Select(N->getOperand(1)),
@@ -873,7 +873,7 @@
} else if (Imm) {
SDOperand Result = Select(BuildSDIVSequence(N));
assert(Result.ResNo == 0);
- CurDAG->ReplaceAllUsesWith(N, Result.Val);
+ CurDAG->ReplaceAllUsesWith(Op, Result);
N = Result.Val;
break;
}
@@ -897,7 +897,7 @@
if (isIntImmediate(N->getOperand(1), Imm) && Imm) {
SDOperand Result = Select(BuildUDIVSequence(N));
assert(Result.ResNo == 0);
- CurDAG->ReplaceAllUsesWith(N, Result.Val);
+ CurDAG->ReplaceAllUsesWith(Op, Result);
N = Result.Val;
break;
}
@@ -940,7 +940,7 @@
if (SDNode *I = SelectIntImmediateExpr(N->getOperand(0),
N->getOperand(1),
PPC::ANDISo, PPC::ANDIo)) {
- CurDAG->ReplaceAllUsesWith(N, I);
+ CurDAG->ReplaceAllUsesWith(Op, SDOperand(I, 0));
N = I;
break;
}
@@ -959,14 +959,14 @@
}
case ISD::OR:
if (SDNode *I = SelectBitfieldInsert(N)) {
- CurDAG->ReplaceAllUsesWith(N, I);
+ CurDAG->ReplaceAllUsesWith(Op, SDOperand(I, 0));
N = I;
break;
}
if (SDNode *I = SelectIntImmediateExpr(N->getOperand(0),
N->getOperand(1),
PPC::ORIS, PPC::ORI)) {
- CurDAG->ReplaceAllUsesWith(N, I);
+ CurDAG->ReplaceAllUsesWith(Op, SDOperand(I, 0));
N = I;
break;
}
@@ -1007,7 +1007,7 @@
if (SDNode *I = SelectIntImmediateExpr(N->getOperand(0),
N->getOperand(1),
PPC::XORIS, PPC::XORI)) {
- CurDAG->ReplaceAllUsesWith(N, I);
+ CurDAG->ReplaceAllUsesWith(Op, SDOperand(I, 0));
N = I;
break;
}
@@ -1070,11 +1070,13 @@
CurDAG->SelectNodeTo(N, PPC::FABS, N->getValueType(0),
Select(N->getOperand(0)));
break;
- case ISD::FP_EXTEND:
+ case ISD::FP_EXTEND: {
assert(MVT::f64 == N->getValueType(0) &&
MVT::f32 == N->getOperand(0).getValueType() && "Illegal FP_EXTEND");
- CurDAG->SelectNodeTo(N, PPC::FMR, MVT::f64, Select(N->getOperand(0)));
- break;
+ SDOperand Tmp = Select(N->getOperand(0));
+ CurDAG->ReplaceAllUsesWith(Op, Tmp); // Just use the operand as the result.
+ return Tmp;
+ }
case ISD::FP_ROUND:
assert(MVT::f32 == N->getValueType(0) &&
MVT::f64 == N->getOperand(0).getValueType() && "Illegal FP_ROUND");
More information about the llvm-commits
mailing list