blob: 669f62f9f17111c1c15b4c716cefea1d667827d6 [file] [log] [blame]
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +00001//===-- MipsISelDAGToDAG.cpp - A dag to dag inst selector for Mips --------===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file defines an instruction selector for the MIPS target.
11//
12//===----------------------------------------------------------------------===//
13
14#define DEBUG_TYPE "mips-isel"
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000015#include "Mips.h"
16#include "MipsISelLowering.h"
Bruno Cardoso Lopesc7db5612007-11-05 03:02:32 +000017#include "MipsMachineFunction.h"
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000018#include "MipsRegisterInfo.h"
19#include "MipsSubtarget.h"
20#include "MipsTargetMachine.h"
21#include "llvm/GlobalValue.h"
22#include "llvm/Instructions.h"
23#include "llvm/Intrinsics.h"
24#include "llvm/Support/CFG.h"
25#include "llvm/Type.h"
26#include "llvm/CodeGen/MachineConstantPool.h"
27#include "llvm/CodeGen/MachineFunction.h"
28#include "llvm/CodeGen/MachineFrameInfo.h"
29#include "llvm/CodeGen/MachineInstrBuilder.h"
Chris Lattner84bc5422007-12-31 04:13:23 +000030#include "llvm/CodeGen/MachineRegisterInfo.h"
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000031#include "llvm/CodeGen/SelectionDAGISel.h"
32#include "llvm/Target/TargetMachine.h"
33#include "llvm/Support/Compiler.h"
34#include "llvm/Support/Debug.h"
35#include <queue>
36#include <set>
37
38using namespace llvm;
39
40//===----------------------------------------------------------------------===//
41// Instruction Selector Implementation
42//===----------------------------------------------------------------------===//
43
44//===----------------------------------------------------------------------===//
45// MipsDAGToDAGISel - MIPS specific code to select MIPS machine
46// instructions for SelectionDAG operations.
47//===----------------------------------------------------------------------===//
48namespace {
49
50class VISIBILITY_HIDDEN MipsDAGToDAGISel : public SelectionDAGISel {
51
52 /// TM - Keep a reference to MipsTargetMachine.
53 MipsTargetMachine &TM;
54
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000055 /// Subtarget - Keep a pointer to the MipsSubtarget around so that we can
56 /// make the right decision when generating code for different targets.
Bruno Cardoso Lopes225ca9c2008-07-05 19:05:21 +000057 const MipsSubtarget &Subtarget;
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000058
59public:
Dan Gohman1002c022008-07-07 18:00:37 +000060 explicit MipsDAGToDAGISel(MipsTargetMachine &tm) :
Dan Gohmanda8ac5f2008-10-03 16:55:19 +000061 SelectionDAGISel(*tm.getTargetLowering()),
62 TM(tm), Subtarget(tm.getSubtarget<MipsSubtarget>()) {}
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000063
Dan Gohmanf350b272008-08-23 02:25:05 +000064 virtual void InstructionSelect();
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000065
66 // Pass Name
67 virtual const char *getPassName() const {
68 return "MIPS DAG->DAG Pattern Instruction Selection";
69 }
70
71
72private:
73 // Include the pieces autogenerated from the target description.
74 #include "MipsGenDAGISel.inc"
75
Dan Gohman475871a2008-07-27 21:46:04 +000076 SDValue getGlobalBaseReg();
77 SDNode *Select(SDValue N);
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000078
79 // Complex Pattern.
Dan Gohman475871a2008-07-27 21:46:04 +000080 bool SelectAddr(SDValue Op, SDValue N,
81 SDValue &Base, SDValue &Offset);
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000082
83
84 // getI32Imm - Return a target constant with the specified
85 // value, of type i32.
Dan Gohman475871a2008-07-27 21:46:04 +000086 inline SDValue getI32Imm(unsigned Imm) {
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000087 return CurDAG->getTargetConstant(Imm, MVT::i32);
88 }
89
90
91 #ifndef NDEBUG
92 unsigned Indent;
93 #endif
94};
95
96}
97
Evan Chengdb8d56b2008-06-30 20:45:06 +000098/// InstructionSelect - This callback is invoked by
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000099/// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
100void MipsDAGToDAGISel::
Dan Gohmanf350b272008-08-23 02:25:05 +0000101InstructionSelect()
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000102{
103 DEBUG(BB->dump());
104 // Codegen the basic block.
105 #ifndef NDEBUG
106 DOUT << "===== Instruction selection begins:\n";
107 Indent = 0;
108 #endif
109
110 // Select target instructions for the DAG.
Dan Gohmanad3460c2008-08-21 16:36:34 +0000111 SelectRoot();
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000112
113 #ifndef NDEBUG
114 DOUT << "===== Instruction selection ends:\n";
115 #endif
116
Dan Gohmanf350b272008-08-23 02:25:05 +0000117 CurDAG->RemoveDeadNodes();
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000118}
119
Bruno Cardoso Lopes753a9872007-11-12 19:49:57 +0000120/// getGlobalBaseReg - Output the instructions required to put the
121/// GOT address into a register.
Dan Gohman475871a2008-07-27 21:46:04 +0000122SDValue MipsDAGToDAGISel::getGlobalBaseReg() {
Bruno Cardoso Lopes753a9872007-11-12 19:49:57 +0000123 MachineFunction* MF = BB->getParent();
124 unsigned GP = 0;
Chris Lattner84bc5422007-12-31 04:13:23 +0000125 for(MachineRegisterInfo::livein_iterator ii = MF->getRegInfo().livein_begin(),
126 ee = MF->getRegInfo().livein_end(); ii != ee; ++ii)
Bruno Cardoso Lopes753a9872007-11-12 19:49:57 +0000127 if (ii->first == Mips::GP) {
128 GP = ii->second;
129 break;
130 }
131 assert(GP && "GOT PTR not in liveins");
132 return CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
133 GP, MVT::i32);
134}
135
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000136/// ComplexPattern used on MipsInstrInfo
137/// Used on Mips Load/Store instructions
138bool MipsDAGToDAGISel::
Dan Gohman475871a2008-07-27 21:46:04 +0000139SelectAddr(SDValue Op, SDValue Addr, SDValue &Offset, SDValue &Base)
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000140{
141 // if Address is FI, get the TargetFrameIndex.
142 if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Addr)) {
143 Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
144 Offset = CurDAG->getTargetConstant(0, MVT::i32);
145 return true;
146 }
147
Bruno Cardoso Lopesc7db5612007-11-05 03:02:32 +0000148 // on PIC code Load GA
149 if (TM.getRelocationModel() == Reloc::PIC_) {
Bruno Cardoso Lopes753a9872007-11-12 19:49:57 +0000150 if ((Addr.getOpcode() == ISD::TargetGlobalAddress) ||
151 (Addr.getOpcode() == ISD::TargetJumpTable)){
Bruno Cardoso Lopesc7db5612007-11-05 03:02:32 +0000152 Base = CurDAG->getRegister(Mips::GP, MVT::i32);
153 Offset = Addr;
154 return true;
155 }
156 } else {
Bill Wendling056292f2008-09-16 21:48:12 +0000157 if ((Addr.getOpcode() == ISD::TargetExternalSymbol ||
Bruno Cardoso Lopesc7db5612007-11-05 03:02:32 +0000158 Addr.getOpcode() == ISD::TargetGlobalAddress))
159 return false;
160 }
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000161
Bruno Cardoso Lopes7ff6fa22007-08-18 02:16:30 +0000162 // Operand is a result from an ADD.
Bruno Cardoso Lopesc7db5612007-11-05 03:02:32 +0000163 if (Addr.getOpcode() == ISD::ADD) {
164 if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Addr.getOperand(1))) {
165 if (Predicate_immSExt16(CN)) {
166
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000167 // If the first operand is a FI, get the TargetFI Node
168 if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>
169 (Addr.getOperand(0))) {
170 Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
171 } else {
172 Base = Addr.getOperand(0);
173 }
174
Dan Gohmanf5aeb1a2008-09-12 16:56:44 +0000175 Offset = CurDAG->getTargetConstant(CN->getZExtValue(), MVT::i32);
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000176 return true;
177 }
178 }
179 }
180
Bruno Cardoso Lopesa4e82002007-07-11 23:24:41 +0000181 Base = Addr;
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000182 Offset = CurDAG->getTargetConstant(0, MVT::i32);
183 return true;
184}
185
186/// Select instructions not customized! Used for
187/// expanded, promoted and normal instructions
188SDNode* MipsDAGToDAGISel::
Dan Gohman475871a2008-07-27 21:46:04 +0000189Select(SDValue N)
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000190{
Gabor Greifba36cb52008-08-28 21:40:38 +0000191 SDNode *Node = N.getNode();
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000192 unsigned Opcode = Node->getOpcode();
193
194 // Dump information about the Node being selected
195 #ifndef NDEBUG
196 DOUT << std::string(Indent, ' ') << "Selecting: ";
197 DEBUG(Node->dump(CurDAG));
198 DOUT << "\n";
199 Indent += 2;
200 #endif
201
202 // If we have a custom node, we already have selected!
Dan Gohmane8be6c62008-07-17 19:10:17 +0000203 if (Node->isMachineOpcode()) {
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000204 #ifndef NDEBUG
205 DOUT << std::string(Indent-2, ' ') << "== ";
206 DEBUG(Node->dump(CurDAG));
207 DOUT << "\n";
208 Indent -= 2;
209 #endif
210 return NULL;
211 }
212
213 ///
Bruno Cardoso Lopesb42abeb2007-09-24 20:15:11 +0000214 // Instruction Selection not handled by the auto-generated
215 // tablegen selection should be handled here.
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000216 ///
217 switch(Opcode) {
218
219 default: break;
220
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000221 case ISD::SUBE:
Bruno Cardoso Lopes07cec752008-06-06 00:58:26 +0000222 case ISD::ADDE: {
Dan Gohman475871a2008-07-27 21:46:04 +0000223 SDValue InFlag = Node->getOperand(2), CmpLHS;
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000224 unsigned Opc = InFlag.getOpcode(), MOp;
225
226 assert(((Opc == ISD::ADDC || Opc == ISD::ADDE) ||
227 (Opc == ISD::SUBC || Opc == ISD::SUBE)) &&
228 "(ADD|SUB)E flag operand must come from (ADD|SUB)C/E insn");
229
230 if (Opcode == ISD::ADDE) {
231 CmpLHS = InFlag.getValue(0);
232 MOp = Mips::ADDu;
233 } else {
234 CmpLHS = InFlag.getOperand(0);
235 MOp = Mips::SUBu;
236 }
237
Dan Gohman475871a2008-07-27 21:46:04 +0000238 SDValue Ops[] = { CmpLHS, InFlag.getOperand(1) };
Bruno Cardoso Lopes07cec752008-06-06 00:58:26 +0000239
Dan Gohman475871a2008-07-27 21:46:04 +0000240 SDValue LHS = Node->getOperand(0);
241 SDValue RHS = Node->getOperand(1);
Bruno Cardoso Lopes07cec752008-06-06 00:58:26 +0000242 AddToISelQueue(LHS);
243 AddToISelQueue(RHS);
244
Duncan Sands83ec4b62008-06-06 12:08:01 +0000245 MVT VT = LHS.getValueType();
Bruno Cardoso Lopes07cec752008-06-06 00:58:26 +0000246 SDNode *Carry = CurDAG->getTargetNode(Mips::SLTu, VT, Ops, 2);
247 SDNode *AddCarry = CurDAG->getTargetNode(Mips::ADDu, VT,
Dan Gohman475871a2008-07-27 21:46:04 +0000248 SDValue(Carry,0), RHS);
Bruno Cardoso Lopes07cec752008-06-06 00:58:26 +0000249
Gabor Greifba36cb52008-08-28 21:40:38 +0000250 return CurDAG->SelectNodeTo(N.getNode(), MOp, VT, MVT::Flag,
Dan Gohman475871a2008-07-27 21:46:04 +0000251 LHS, SDValue(AddCarry,0));
Bruno Cardoso Lopes07cec752008-06-06 00:58:26 +0000252 }
253
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000254 /// Mul/Div with two results
255 case ISD::SDIVREM:
256 case ISD::UDIVREM:
257 case ISD::SMUL_LOHI:
258 case ISD::UMUL_LOHI: {
Dan Gohman475871a2008-07-27 21:46:04 +0000259 SDValue Op1 = Node->getOperand(0);
260 SDValue Op2 = Node->getOperand(1);
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000261 AddToISelQueue(Op1);
262 AddToISelQueue(Op2);
Bruno Cardoso Lopes07cec752008-06-06 00:58:26 +0000263
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000264 unsigned Op;
265 if (Opcode == ISD::UMUL_LOHI || Opcode == ISD::SMUL_LOHI)
266 Op = (Opcode == ISD::UMUL_LOHI ? Mips::MULTu : Mips::MULT);
267 else
268 Op = (Opcode == ISD::UDIVREM ? Mips::DIVu : Mips::DIV);
Bruno Cardoso Lopes07cec752008-06-06 00:58:26 +0000269
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000270 SDNode *Node = CurDAG->getTargetNode(Op, MVT::Flag, Op1, Op2);
Bruno Cardoso Lopes07cec752008-06-06 00:58:26 +0000271
Dan Gohman475871a2008-07-27 21:46:04 +0000272 SDValue InFlag = SDValue(Node, 0);
Bruno Cardoso Lopes7b76da12008-07-09 04:45:36 +0000273 SDNode *Lo = CurDAG->getTargetNode(Mips::MFLO, MVT::i32,
274 MVT::Flag, InFlag);
Dan Gohman475871a2008-07-27 21:46:04 +0000275 InFlag = SDValue(Lo,1);
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000276 SDNode *Hi = CurDAG->getTargetNode(Mips::MFHI, MVT::i32, InFlag);
277
278 if (!N.getValue(0).use_empty())
Dan Gohman475871a2008-07-27 21:46:04 +0000279 ReplaceUses(N.getValue(0), SDValue(Lo,0));
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000280
281 if (!N.getValue(1).use_empty())
Dan Gohman475871a2008-07-27 21:46:04 +0000282 ReplaceUses(N.getValue(1), SDValue(Hi,0));
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000283
284 return NULL;
Bruno Cardoso Lopes07cec752008-06-06 00:58:26 +0000285 }
286
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000287 /// Special Muls
288 case ISD::MUL:
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000289 case ISD::MULHS:
290 case ISD::MULHU: {
Dan Gohman475871a2008-07-27 21:46:04 +0000291 SDValue MulOp1 = Node->getOperand(0);
292 SDValue MulOp2 = Node->getOperand(1);
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000293 AddToISelQueue(MulOp1);
294 AddToISelQueue(MulOp2);
295
296 unsigned MulOp = (Opcode == ISD::MULHU ? Mips::MULTu : Mips::MULT);
297 SDNode *MulNode = CurDAG->getTargetNode(MulOp, MVT::Flag, MulOp1, MulOp2);
298
Dan Gohman475871a2008-07-27 21:46:04 +0000299 SDValue InFlag = SDValue(MulNode, 0);
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000300
301 if (MulOp == ISD::MUL)
302 return CurDAG->getTargetNode(Mips::MFLO, MVT::i32, InFlag);
303 else
304 return CurDAG->getTargetNode(Mips::MFHI, MVT::i32, InFlag);
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000305 }
306
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000307 /// Div/Rem operations
308 case ISD::SREM:
309 case ISD::UREM:
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000310 case ISD::SDIV:
311 case ISD::UDIV: {
Dan Gohman475871a2008-07-27 21:46:04 +0000312 SDValue Op1 = Node->getOperand(0);
313 SDValue Op2 = Node->getOperand(1);
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000314 AddToISelQueue(Op1);
315 AddToISelQueue(Op2);
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000316
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000317 unsigned Op, MOp;
318 if (Opcode == ISD::SDIV || Opcode == ISD::UDIV) {
319 Op = (Opcode == ISD::SDIV ? Mips::DIV : Mips::DIVu);
320 MOp = Mips::MFLO;
321 } else {
322 Op = (Opcode == ISD::SREM ? Mips::DIV : Mips::DIVu);
323 MOp = Mips::MFHI;
324 }
325 SDNode *Node = CurDAG->getTargetNode(Op, MVT::Flag, Op1, Op2);
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000326
Dan Gohman475871a2008-07-27 21:46:04 +0000327 SDValue InFlag = SDValue(Node, 0);
Bruno Cardoso Lopes0af5e092008-06-06 06:37:31 +0000328 return CurDAG->getTargetNode(MOp, MVT::i32, InFlag);
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000329 }
Bruno Cardoso Lopesc7db5612007-11-05 03:02:32 +0000330
Bruno Cardoso Lopes753a9872007-11-12 19:49:57 +0000331 // Get target GOT address.
332 case ISD::GLOBAL_OFFSET_TABLE: {
Dan Gohman475871a2008-07-27 21:46:04 +0000333 SDValue Result = getGlobalBaseReg();
Bruno Cardoso Lopes753a9872007-11-12 19:49:57 +0000334 ReplaceUses(N, Result);
335 return NULL;
336 }
337
Bruno Cardoso Lopesc7db5612007-11-05 03:02:32 +0000338 /// Handle direct and indirect calls when using PIC. On PIC, when
339 /// GOT is smaller than about 64k (small code) the GA target is
340 /// loaded with only one instruction. Otherwise GA's target must
341 /// be loaded with 3 instructions.
342 case MipsISD::JmpLink: {
343 if (TM.getRelocationModel() == Reloc::PIC_) {
344 //bool isCodeLarge = (TM.getCodeModel() == CodeModel::Large);
Dan Gohman475871a2008-07-27 21:46:04 +0000345 SDValue Chain = Node->getOperand(0);
346 SDValue Callee = Node->getOperand(1);
Bruno Cardoso Lopesc7db5612007-11-05 03:02:32 +0000347 AddToISelQueue(Chain);
Dan Gohman475871a2008-07-27 21:46:04 +0000348 SDValue T9Reg = CurDAG->getRegister(Mips::T9, MVT::i32);
349 SDValue InFlag(0, 0);
Bruno Cardoso Lopesc7db5612007-11-05 03:02:32 +0000350
351 if ( (isa<GlobalAddressSDNode>(Callee)) ||
Bill Wendling056292f2008-09-16 21:48:12 +0000352 (isa<ExternalSymbolSDNode>(Callee)) )
Bruno Cardoso Lopesc7db5612007-11-05 03:02:32 +0000353 {
354 /// Direct call for global addresses and external symbols
Dan Gohman475871a2008-07-27 21:46:04 +0000355 SDValue GPReg = CurDAG->getRegister(Mips::GP, MVT::i32);
Bruno Cardoso Lopesc7db5612007-11-05 03:02:32 +0000356
357 // Use load to get GOT target
Dan Gohman475871a2008-07-27 21:46:04 +0000358 SDValue Ops[] = { Callee, GPReg, Chain };
359 SDValue Load = SDValue(CurDAG->getTargetNode(Mips::LW, MVT::i32,
Bruno Cardoso Lopesc7db5612007-11-05 03:02:32 +0000360 MVT::Other, Ops, 3), 0);
361 Chain = Load.getValue(1);
362 AddToISelQueue(Chain);
363
364 // Call target must be on T9
365 Chain = CurDAG->getCopyToReg(Chain, T9Reg, Load, InFlag);
366 } else
367 /// Indirect call
368 Chain = CurDAG->getCopyToReg(Chain, T9Reg, Callee, InFlag);
369
370 AddToISelQueue(Chain);
371
372 // Emit Jump and Link Register
373 SDNode *ResNode = CurDAG->getTargetNode(Mips::JALR, MVT::Other,
374 MVT::Flag, T9Reg, Chain);
Dan Gohman475871a2008-07-27 21:46:04 +0000375 Chain = SDValue(ResNode, 0);
376 InFlag = SDValue(ResNode, 1);
377 ReplaceUses(SDValue(Node, 0), Chain);
378 ReplaceUses(SDValue(Node, 1), InFlag);
Bruno Cardoso Lopesc7db5612007-11-05 03:02:32 +0000379 return ResNode;
380 }
381 }
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000382 }
383
384 // Select the default instruction
385 SDNode *ResNode = SelectCode(N);
386
387 #ifndef NDEBUG
388 DOUT << std::string(Indent-2, ' ') << "=> ";
Gabor Greifba36cb52008-08-28 21:40:38 +0000389 if (ResNode == NULL || ResNode == N.getNode())
390 DEBUG(N.getNode()->dump(CurDAG));
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +0000391 else
392 DEBUG(ResNode->dump(CurDAG));
393 DOUT << "\n";
394 Indent -= 2;
395 #endif
396
397 return ResNode;
398}
399
400/// createMipsISelDag - This pass converts a legalized DAG into a
401/// MIPS-specific DAG, ready for instruction scheduling.
402FunctionPass *llvm::createMipsISelDag(MipsTargetMachine &TM) {
403 return new MipsDAGToDAGISel(TM);
404}