diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-08-07 22:28:20 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-08-07 22:28:20 +0000 |
commit | 2ef88a09b71f458ad415b35a1fb431c3d15d7eb1 (patch) | |
tree | 7613ee1f6ed2f9119c8112a71d2f24b60809a055 /lib/Target/Sparc/SparcISelDAGToDAG.cpp | |
parent | 9bdca0302a0492a6211aa06ba374679ddad63108 (diff) |
Match tablegen isel changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29549 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc/SparcISelDAGToDAG.cpp')
-rw-r--r-- | lib/Target/Sparc/SparcISelDAGToDAG.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/Target/Sparc/SparcISelDAGToDAG.cpp b/lib/Target/Sparc/SparcISelDAGToDAG.cpp index 1004109524..a0f52f0f3e 100644 --- a/lib/Target/Sparc/SparcISelDAGToDAG.cpp +++ b/lib/Target/Sparc/SparcISelDAGToDAG.cpp @@ -25,6 +25,7 @@ #include "llvm/Target/TargetLowering.h" #include "llvm/Support/Debug.h" #include <iostream> +#include <queue> #include <set> using namespace llvm; @@ -1001,9 +1002,6 @@ void SparcDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { // Select target instructions for the DAG. DAG.setRoot(SelectRoot(DAG.getRoot())); - CodeGenMap.clear(); - HandleMap.clear(); - ReplaceMap.clear(); DAG.RemoveDeadNodes(); // Emit machine code to BB. @@ -1083,21 +1081,14 @@ void SparcDAGToDAGISel::Select(SDOperand &Result, SDOperand Op) { return; // Already selected. } - // If this has already been converted, use it. - std::map<SDOperand, SDOperand>::iterator CGMI = CodeGenMap.find(Op); - if (CGMI != CodeGenMap.end()) { - Result = CGMI->second; - return; - } - switch (N->getOpcode()) { default: break; case ISD::SDIV: case ISD::UDIV: { // FIXME: should use a custom expander to expose the SRA to the dag. SDOperand DivLHS, DivRHS; - Select(DivLHS, N->getOperand(0)); - Select(DivRHS, N->getOperand(1)); + AddToQueue(DivLHS, N->getOperand(0)); + AddToQueue(DivRHS, N->getOperand(1)); // Set the Y register to the high-part. SDOperand TopPart; @@ -1119,8 +1110,8 @@ void SparcDAGToDAGISel::Select(SDOperand &Result, SDOperand Op) { case ISD::MULHS: { // FIXME: Handle mul by immediate. SDOperand MulLHS, MulRHS; - Select(MulLHS, N->getOperand(0)); - Select(MulRHS, N->getOperand(1)); + AddToQueue(MulLHS, N->getOperand(0)); + AddToQueue(MulRHS, N->getOperand(1)); unsigned Opcode = N->getOpcode() == ISD::MULHU ? SP::UMULrr : SP::SMULrr; SDNode *Mul = CurDAG->getTargetNode(Opcode, MVT::i32, MVT::Flag, MulLHS, MulRHS); |