diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-08-16 07:30:09 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-08-16 07:30:09 +0000 |
commit | 23329f5e0366af7cd9a96572ed8d6322696e5846 (patch) | |
tree | e07e79622c36c6e0c9cb422939fde84125070bab /lib/Target/Alpha/AlphaISelDAGToDAG.cpp | |
parent | 4b790573f7c7e5652588b79c6648f5b8fc0ddd84 (diff) | |
download | external_llvm-23329f5e0366af7cd9a96572ed8d6322696e5846.zip external_llvm-23329f5e0366af7cd9a96572ed8d6322696e5846.tar.gz external_llvm-23329f5e0366af7cd9a96572ed8d6322696e5846.tar.bz2 |
SelectNodeTo() may return a SDOperand that is different from the input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Alpha/AlphaISelDAGToDAG.cpp')
-rw-r--r-- | lib/Target/Alpha/AlphaISelDAGToDAG.cpp | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/lib/Target/Alpha/AlphaISelDAGToDAG.cpp b/lib/Target/Alpha/AlphaISelDAGToDAG.cpp index 8cc95ab..22a99f2 100644 --- a/lib/Target/Alpha/AlphaISelDAGToDAG.cpp +++ b/lib/Target/Alpha/AlphaISelDAGToDAG.cpp @@ -197,10 +197,9 @@ SDNode *AlphaDAGToDAGISel::Select(SDOperand &Result, SDOperand Op) { case ISD::FrameIndex: { int FI = cast<FrameIndexSDNode>(N)->getIndex(); - Result = CurDAG->SelectNodeTo(N, Alpha::LDA, MVT::i64, - CurDAG->getTargetFrameIndex(FI, MVT::i32), - getI64Imm(0)); - return NULL; + return CurDAG->SelectNodeTo(N, Alpha::LDA, MVT::i64, + CurDAG->getTargetFrameIndex(FI, MVT::i32), + getI64Imm(0)).Val; } case AlphaISD::GlobalBaseReg: Result = getGlobalBaseReg(); @@ -228,8 +227,7 @@ SDNode *AlphaDAGToDAGISel::Select(SDOperand &Result, SDOperand Op) { Chain, Chain.getValue(1)); Chain = CurDAG->getCopyFromReg(Chain, Alpha::R27, MVT::i64, SDOperand(CNode, 1)); - Result = CurDAG->SelectNodeTo(N, Alpha::BIS, MVT::i64, Chain, Chain); - return NULL; + return CurDAG->SelectNodeTo(N, Alpha::BIS, MVT::i64, Chain, Chain).Val; } case ISD::READCYCLECOUNTER: { @@ -266,24 +264,21 @@ SDNode *AlphaDAGToDAGISel::Select(SDOperand &Result, SDOperand Op) { SDOperand CPI = CurDAG->getTargetConstantPool(C, MVT::i64); SDNode *Tmp = CurDAG->getTargetNode(Alpha::LDAHr, MVT::i64, CPI, getGlobalBaseReg()); - Result = CurDAG->SelectNodeTo(N, Alpha::LDQr, MVT::i64, MVT::Other, - CPI, SDOperand(Tmp, 0), CurDAG->getEntryNode()); - return NULL; + return CurDAG->SelectNodeTo(N, Alpha::LDQr, MVT::i64, MVT::Other, + CPI, SDOperand(Tmp, 0), CurDAG->getEntryNode()).Val; } case ISD::TargetConstantFP: { ConstantFPSDNode *CN = cast<ConstantFPSDNode>(N); bool isDouble = N->getValueType(0) == MVT::f64; MVT::ValueType T = isDouble ? MVT::f64 : MVT::f32; if (CN->isExactlyValue(+0.0)) { - Result = CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYST : Alpha::CPYSS, - T, CurDAG->getRegister(Alpha::F31, T), - CurDAG->getRegister(Alpha::F31, T)); - return NULL; + return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYST : Alpha::CPYSS, + T, CurDAG->getRegister(Alpha::F31, T), + CurDAG->getRegister(Alpha::F31, T)).Val; } else if ( CN->isExactlyValue(-0.0)) { - Result = CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYSNT : Alpha::CPYSNS, - T, CurDAG->getRegister(Alpha::F31, T), - CurDAG->getRegister(Alpha::F31, T)); - return NULL; + return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYSNT : Alpha::CPYSNS, + T, CurDAG->getRegister(Alpha::F31, T), + CurDAG->getRegister(Alpha::F31, T)).Val; } else { abort(); } |