1894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===-- SparcISelDAGToDAG.cpp - A dag to dag inst selector for Sparc ------===//
2894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
3894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//                     The LLVM Compiler Infrastructure
4894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
5894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// This file is distributed under the University of Illinois Open Source
6894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// License. See LICENSE.TXT for details.
7894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
8894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===----------------------------------------------------------------------===//
9894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
10894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// This file defines an instruction selector for the SPARC target.
11894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//
12894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===----------------------------------------------------------------------===//
13894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
14894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#include "SparcTargetMachine.h"
15894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#include "llvm/Intrinsics.h"
16894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#include "llvm/CodeGen/SelectionDAGISel.h"
17894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#include "llvm/Support/Compiler.h"
18894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#include "llvm/Support/Debug.h"
19894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#include "llvm/Support/ErrorHandling.h"
20894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#include "llvm/Support/raw_ostream.h"
21894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanusing namespace llvm;
22894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
23894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===----------------------------------------------------------------------===//
24894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// Instruction Selector Implementation
25894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===----------------------------------------------------------------------===//
26894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
27894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===--------------------------------------------------------------------===//
28894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// SparcDAGToDAGISel - SPARC specific code to select SPARC machine
29894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// instructions for SelectionDAG operations.
30894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman///
31894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumannamespace {
32894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanclass SparcDAGToDAGISel : public SelectionDAGISel {
33894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  /// Subtarget - Keep a pointer to the Sparc Subtarget around so that we can
34894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  /// make the right decision when generating code for different targets.
35894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  const SparcSubtarget &Subtarget;
36894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  SparcTargetMachine& TM;
37894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanpublic:
38894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  explicit SparcDAGToDAGISel(SparcTargetMachine &tm)
39894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    : SelectionDAGISel(tm),
40894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      Subtarget(tm.getSubtarget<SparcSubtarget>()),
41894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      TM(tm) {
42894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
43894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
44894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  SDNode *Select(SDNode *N);
45894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
46894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  // Complex Pattern Selectors.
4719bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  bool SelectADDRrr(SDValue N, SDValue &R1, SDValue &R2);
4819bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman  bool SelectADDRri(SDValue N, SDValue &Base, SDValue &Offset);
49894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
50894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
51894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  /// inline asm expressions.
52894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  virtual bool SelectInlineAsmMemoryOperand(const SDValue &Op,
53894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                                            char ConstraintCode,
54894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                                            std::vector<SDValue> &OutOps);
55894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
56894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  virtual const char *getPassName() const {
57894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return "SPARC DAG->DAG Pattern Instruction Selection";
58894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
59894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
60894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  // Include the pieces autogenerated from the target description.
61894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#include "SparcGenDAGISel.inc"
62894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
63894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanprivate:
64894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  SDNode* getGlobalBaseReg();
65894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman};
66894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman}  // end anonymous namespace
67894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
68894018228b0e0bdbd7aa7e8f47d4a9458789ca82John BaumanSDNode* SparcDAGToDAGISel::getGlobalBaseReg() {
69894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  unsigned GlobalBaseReg = TM.getInstrInfo()->getGlobalBaseReg(MF);
70894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  return CurDAG->getRegister(GlobalBaseReg, TLI.getPointerTy()).getNode();
71894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman}
72894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
7319bac1e08be200c31efd26f0f5fd144c9b3eefd3John Baumanbool SparcDAGToDAGISel::SelectADDRri(SDValue Addr,
74894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                                     SDValue &Base, SDValue &Offset) {
75894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Addr)) {
76894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
77894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    Offset = CurDAG->getTargetConstant(0, MVT::i32);
78894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return true;
79894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
80894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  if (Addr.getOpcode() == ISD::TargetExternalSymbol ||
81894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      Addr.getOpcode() == ISD::TargetGlobalAddress)
82894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return false;  // direct calls.
83894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
84894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  if (Addr.getOpcode() == ISD::ADD) {
85894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Addr.getOperand(1))) {
8619bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman      if (isInt<13>(CN->getSExtValue())) {
87894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman        if (FrameIndexSDNode *FIN =
88894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                dyn_cast<FrameIndexSDNode>(Addr.getOperand(0))) {
89894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman          // Constant offset from frame ref.
90894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman          Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
91894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman        } else {
92894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman          Base = Addr.getOperand(0);
93894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman        }
94894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman        Offset = CurDAG->getTargetConstant(CN->getZExtValue(), MVT::i32);
95894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman        return true;
96894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      }
97894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    }
98894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    if (Addr.getOperand(0).getOpcode() == SPISD::Lo) {
99894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      Base = Addr.getOperand(1);
100894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      Offset = Addr.getOperand(0).getOperand(0);
101894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      return true;
102894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    }
103894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    if (Addr.getOperand(1).getOpcode() == SPISD::Lo) {
104894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      Base = Addr.getOperand(0);
105894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      Offset = Addr.getOperand(1).getOperand(0);
106894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      return true;
107894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    }
108894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
109894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  Base = Addr;
110894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  Offset = CurDAG->getTargetConstant(0, MVT::i32);
111894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  return true;
112894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman}
113894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
11419bac1e08be200c31efd26f0f5fd144c9b3eefd3John Baumanbool SparcDAGToDAGISel::SelectADDRrr(SDValue Addr, SDValue &R1, SDValue &R2) {
115894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  if (Addr.getOpcode() == ISD::FrameIndex) return false;
116894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  if (Addr.getOpcode() == ISD::TargetExternalSymbol ||
117894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      Addr.getOpcode() == ISD::TargetGlobalAddress)
118894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return false;  // direct calls.
119894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
120894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  if (Addr.getOpcode() == ISD::ADD) {
12119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman    if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Addr.getOperand(1)))
12219bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman      if (isInt<13>(CN->getSExtValue()))
12319bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman        return false;  // Let the reg+imm pattern catch this!
124894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    if (Addr.getOperand(0).getOpcode() == SPISD::Lo ||
125894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman        Addr.getOperand(1).getOpcode() == SPISD::Lo)
126894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      return false;  // Let the reg+imm pattern catch this!
127894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    R1 = Addr.getOperand(0);
128894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    R2 = Addr.getOperand(1);
129894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return true;
130894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
131894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
132894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  R1 = Addr;
133894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  R2 = CurDAG->getRegister(SP::G0, MVT::i32);
134894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  return true;
135894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman}
136894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
137894018228b0e0bdbd7aa7e8f47d4a9458789ca82John BaumanSDNode *SparcDAGToDAGISel::Select(SDNode *N) {
138894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  DebugLoc dl = N->getDebugLoc();
139894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  if (N->isMachineOpcode())
140894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return NULL;   // Already selected.
141894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
142894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  switch (N->getOpcode()) {
143894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  default: break;
144894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  case SPISD::GLOBAL_BASE_REG:
145894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return getGlobalBaseReg();
146894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
147894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  case ISD::SDIV:
148894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  case ISD::UDIV: {
149894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    // FIXME: should use a custom expander to expose the SRA to the dag.
150894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    SDValue DivLHS = N->getOperand(0);
151894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    SDValue DivRHS = N->getOperand(1);
152894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
153894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    // Set the Y register to the high-part.
154894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    SDValue TopPart;
155894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    if (N->getOpcode() == ISD::SDIV) {
156894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      TopPart = SDValue(CurDAG->getMachineNode(SP::SRAri, dl, MVT::i32, DivLHS,
157894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                                   CurDAG->getTargetConstant(31, MVT::i32)), 0);
158894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    } else {
159894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman      TopPart = CurDAG->getRegister(SP::G0, MVT::i32);
160894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    }
16119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman    TopPart = SDValue(CurDAG->getMachineNode(SP::WRYrr, dl, MVT::Glue, TopPart,
162894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                                     CurDAG->getRegister(SP::G0, MVT::i32)), 0);
163894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
164894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    // FIXME: Handle div by immediate.
165894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    unsigned Opcode = N->getOpcode() == ISD::SDIV ? SP::SDIVrr : SP::UDIVrr;
166894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return CurDAG->SelectNodeTo(N, Opcode, MVT::i32, DivLHS, DivRHS,
167894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                                TopPart);
168894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
169894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  case ISD::MULHU:
170894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  case ISD::MULHS: {
171894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    // FIXME: Handle mul by immediate.
172894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    SDValue MulLHS = N->getOperand(0);
173894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    SDValue MulRHS = N->getOperand(1);
174894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    unsigned Opcode = N->getOpcode() == ISD::MULHU ? SP::UMULrr : SP::SMULrr;
17519bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman    SDNode *Mul = CurDAG->getMachineNode(Opcode, dl, MVT::i32, MVT::Glue,
176894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                                         MulLHS, MulRHS);
177894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    // The high part is in the Y register.
178894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return CurDAG->SelectNodeTo(N, SP::RDY, MVT::i32, SDValue(Mul, 1));
179894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman    return NULL;
180894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
181894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
182894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
183894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  return SelectCode(N);
184894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman}
185894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
186894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
187894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
188894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// inline asm expressions.
189894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumanbool
190894018228b0e0bdbd7aa7e8f47d4a9458789ca82John BaumanSparcDAGToDAGISel::SelectInlineAsmMemoryOperand(const SDValue &Op,
191894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                                                char ConstraintCode,
192894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman                                                std::vector<SDValue> &OutOps) {
193894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  SDValue Op0, Op1;
194894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  switch (ConstraintCode) {
195894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  default: return true;
196894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  case 'm':   // memory
19719bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman   if (!SelectADDRrr(Op, Op0, Op1))
19819bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman     SelectADDRri(Op, Op0, Op1);
199894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman   break;
200894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  }
201894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
202894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  OutOps.push_back(Op0);
203894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  OutOps.push_back(Op1);
204894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  return false;
205894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman}
206894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman
207894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// createSparcISelDag - This pass converts a legalized DAG into a
208894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman/// SPARC-specific DAG, ready for instruction scheduling.
209894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman///
210894018228b0e0bdbd7aa7e8f47d4a9458789ca82John BaumanFunctionPass *llvm::createSparcISelDag(SparcTargetMachine &TM) {
211894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman  return new SparcDAGToDAGISel(TM);
212894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman}
213