[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Oct 25 13:26:52 PDT 2005
Changes in directory llvm/lib/Target/PowerPC:
PPCISelDAGToDAG.cpp updated: 1.117 -> 1.118
---
Log message:
Be a bit more paranoid about calling SelectNodeTo
---
Diffs of the changes: (+11 -7)
PPCISelDAGToDAG.cpp | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.117 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.118
--- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.117 Tue Oct 25 14:32:37 2005
+++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Tue Oct 25 15:26:41 2005
@@ -886,10 +886,15 @@
return SDOperand(N, 0);
case ISD::FrameIndex: {
int FI = cast<FrameIndexSDNode>(N)->getIndex();
- CurDAG->SelectNodeTo(N, PPC::ADDI, MVT::i32,
- CurDAG->getTargetFrameIndex(FI, MVT::i32),
- getI32Imm(0));
- return SDOperand(N, 0);
+ if (N->hasOneUse()) {
+ CurDAG->SelectNodeTo(N, PPC::ADDI, MVT::i32,
+ CurDAG->getTargetFrameIndex(FI, MVT::i32),
+ getI32Imm(0));
+ return SDOperand(N, 0);
+ }
+ return CurDAG->getTargetNode(PPC::ADDI, MVT::i32,
+ CurDAG->getTargetFrameIndex(FI, MVT::i32),
+ getI32Imm(0));
}
case ISD::ConstantPool: {
Constant *C = cast<ConstantPoolSDNode>(N)->get();
@@ -914,10 +919,9 @@
Tmp = CurDAG->getTargetNode(PPC::LIS, MVT::i32, GA);
if (GV->hasWeakLinkage() || GV->isExternal())
- CurDAG->SelectNodeTo(N, PPC::LWZ, MVT::i32, GA, Tmp);
+ return CurDAG->getTargetNode(PPC::LWZ, MVT::i32, GA, Tmp);
else
- CurDAG->SelectNodeTo(N, PPC::LA, MVT::i32, Tmp, GA);
- return SDOperand(N, 0);
+ return CurDAG->getTargetNode(PPC::LA, MVT::i32, Tmp, GA);
}
case PPCISD::FSEL: {
More information about the llvm-commits
mailing list