Have TableGen emit setSubgraphColor calls under control of a -gen-debug
[oota-llvm.git] / lib / Target / Alpha / AlphaISelDAGToDAG.cpp
1 //===-- AlphaISelDAGToDAG.cpp - Alpha pattern matching inst selector ------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines a pattern matching instruction selector for Alpha,
11 // converting from a legalized dag to a Alpha dag.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include "Alpha.h"
16 #include "AlphaTargetMachine.h"
17 #include "AlphaISelLowering.h"
18 #include "llvm/CodeGen/MachineInstrBuilder.h"
19 #include "llvm/CodeGen/MachineFrameInfo.h"
20 #include "llvm/CodeGen/MachineFunction.h"
21 #include "llvm/CodeGen/MachineRegisterInfo.h"
22 #include "llvm/CodeGen/SelectionDAG.h"
23 #include "llvm/CodeGen/SelectionDAGISel.h"
24 #include "llvm/Target/TargetOptions.h"
25 #include "llvm/Constants.h"
26 #include "llvm/DerivedTypes.h"
27 #include "llvm/GlobalValue.h"
28 #include "llvm/Intrinsics.h"
29 #include "llvm/Support/Compiler.h"
30 #include "llvm/Support/Debug.h"
31 #include "llvm/Support/MathExtras.h"
32 #include <algorithm>
33 using namespace llvm;
34
35 namespace {
36
37   //===--------------------------------------------------------------------===//
38   /// AlphaDAGToDAGISel - Alpha specific code to select Alpha machine
39   /// instructions for SelectionDAG operations.
40   class AlphaDAGToDAGISel : public SelectionDAGISel {
41     static const int64_t IMM_LOW  = -32768;
42     static const int64_t IMM_HIGH = 32767;
43     static const int64_t IMM_MULT = 65536;
44     static const int64_t IMM_FULLHIGH = IMM_HIGH + IMM_HIGH * IMM_MULT;
45     static const int64_t IMM_FULLLOW = IMM_LOW + IMM_LOW  * IMM_MULT;
46
47     static int64_t get_ldah16(int64_t x) {
48       int64_t y = x / IMM_MULT;
49       if (x % IMM_MULT > IMM_HIGH)
50         ++y;
51       return y;
52     }
53
54     static int64_t get_lda16(int64_t x) {
55       return x - get_ldah16(x) * IMM_MULT;
56     }
57
58     /// get_zapImm - Return a zap mask if X is a valid immediate for a zapnot
59     /// instruction (if not, return 0).  Note that this code accepts partial
60     /// zap masks.  For example (and LHS, 1) is a valid zap, as long we know
61     /// that the bits 1-7 of LHS are already zero.  If LHS is non-null, we are
62     /// in checking mode.  If LHS is null, we assume that the mask has already
63     /// been validated before.
64     uint64_t get_zapImm(SDValue LHS, uint64_t Constant) {
65       uint64_t BitsToCheck = 0;
66       unsigned Result = 0;
67       for (unsigned i = 0; i != 8; ++i) {
68         if (((Constant >> 8*i) & 0xFF) == 0) {
69           // nothing to do.
70         } else {
71           Result |= 1 << i;
72           if (((Constant >> 8*i) & 0xFF) == 0xFF) {
73             // If the entire byte is set, zapnot the byte.
74           } else if (LHS.getNode() == 0) {
75             // Otherwise, if the mask was previously validated, we know its okay
76             // to zapnot this entire byte even though all the bits aren't set.
77           } else {
78             // Otherwise we don't know that the it's okay to zapnot this entire
79             // byte.  Only do this iff we can prove that the missing bits are
80             // already null, so the bytezap doesn't need to really null them.
81             BitsToCheck |= ~Constant & (0xFF << 8*i);
82           }
83         }
84       }
85       
86       // If there are missing bits in a byte (for example, X & 0xEF00), check to
87       // see if the missing bits (0x1000) are already known zero if not, the zap
88       // isn't okay to do, as it won't clear all the required bits.
89       if (BitsToCheck &&
90           !CurDAG->MaskedValueIsZero(LHS,
91                                      APInt(LHS.getValueSizeInBits(),
92                                            BitsToCheck)))
93         return 0;
94       
95       return Result;
96     }
97     
98     static uint64_t get_zapImm(uint64_t x) {
99       unsigned build = 0;
100       for(int i = 0; i != 8; ++i) {
101         if ((x & 0x00FF) == 0x00FF)
102           build |= 1 << i;
103         else if ((x & 0x00FF) != 0)
104           return 0;
105         x >>= 8;
106       }
107       return build;
108     }
109       
110     
111     static uint64_t getNearPower2(uint64_t x) {
112       if (!x) return 0;
113       unsigned at = CountLeadingZeros_64(x);
114       uint64_t complow = 1 << (63 - at);
115       uint64_t comphigh = 1 << (64 - at);
116       //cerr << x << ":" << complow << ":" << comphigh << "\n";
117       if (abs(complow - x) <= abs(comphigh - x))
118         return complow;
119       else
120         return comphigh;
121     }
122
123     static bool chkRemNearPower2(uint64_t x, uint64_t r, bool swap) {
124       uint64_t y = getNearPower2(x);
125       if (swap)
126         return (y - x) == r;
127       else
128         return (x - y) == r;
129     }
130
131     static bool isFPZ(SDValue N) {
132       ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(N);
133       return (CN && (CN->getValueAPF().isZero()));
134     }
135     static bool isFPZn(SDValue N) {
136       ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(N);
137       return (CN && CN->getValueAPF().isNegZero());
138     }
139     static bool isFPZp(SDValue N) {
140       ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(N);
141       return (CN && CN->getValueAPF().isPosZero());
142     }
143
144   public:
145     explicit AlphaDAGToDAGISel(AlphaTargetMachine &TM)
146       : SelectionDAGISel(*TM.getTargetLowering())
147     {}
148
149     /// getI64Imm - Return a target constant with the specified value, of type
150     /// i64.
151     inline SDValue getI64Imm(int64_t Imm) {
152       return CurDAG->getTargetConstant(Imm, MVT::i64);
153     }
154
155     // Select - Convert the specified operand from a target-independent to a
156     // target-specific node if it hasn't already been changed.
157     SDNode *Select(SDValue Op);
158     
159     /// InstructionSelect - This callback is invoked by
160     /// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
161     virtual void InstructionSelect();
162     
163     virtual const char *getPassName() const {
164       return "Alpha DAG->DAG Pattern Instruction Selection";
165     } 
166
167     /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
168     /// inline asm expressions.
169     virtual bool SelectInlineAsmMemoryOperand(const SDValue &Op,
170                                               char ConstraintCode,
171                                               std::vector<SDValue> &OutOps) {
172       SDValue Op0;
173       switch (ConstraintCode) {
174       default: return true;
175       case 'm':   // memory
176         Op0 = Op;
177         AddToISelQueue(Op0);
178         break;
179       }
180       
181       OutOps.push_back(Op0);
182       return false;
183     }
184     
185 // Include the pieces autogenerated from the target description.
186 #include "AlphaGenDAGISel.inc"
187     
188 private:
189     SDValue getGlobalBaseReg();
190     SDValue getGlobalRetAddr();
191     void SelectCALL(SDValue Op);
192
193   };
194 }
195
196 /// getGlobalBaseReg - Output the instructions required to put the
197 /// GOT address into a register.
198 ///
199 SDValue AlphaDAGToDAGISel::getGlobalBaseReg() {
200   unsigned GP = 0;
201   for(MachineRegisterInfo::livein_iterator ii = RegInfo->livein_begin(), 
202         ee = RegInfo->livein_end(); ii != ee; ++ii)
203     if (ii->first == Alpha::R29) {
204       GP = ii->second;
205       break;
206     }
207   assert(GP && "GOT PTR not in liveins");
208   return CurDAG->getCopyFromReg(CurDAG->getEntryNode(), 
209                                 GP, MVT::i64);
210 }
211
212 /// getRASaveReg - Grab the return address
213 ///
214 SDValue AlphaDAGToDAGISel::getGlobalRetAddr() {
215   unsigned RA = 0;
216   for(MachineRegisterInfo::livein_iterator ii = RegInfo->livein_begin(), 
217         ee = RegInfo->livein_end(); ii != ee; ++ii)
218     if (ii->first == Alpha::R26) {
219       RA = ii->second;
220       break;
221     }
222   assert(RA && "RA PTR not in liveins");
223   return CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
224                                 RA, MVT::i64);
225 }
226
227 /// InstructionSelect - This callback is invoked by
228 /// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
229 void AlphaDAGToDAGISel::InstructionSelect() {
230   DEBUG(BB->dump());
231   
232   // Select target instructions for the DAG.
233   SelectRoot(*CurDAG);
234   CurDAG->RemoveDeadNodes();
235 }
236
237 // Select - Convert the specified operand from a target-independent to a
238 // target-specific node if it hasn't already been changed.
239 SDNode *AlphaDAGToDAGISel::Select(SDValue Op) {
240   SDNode *N = Op.getNode();
241   if (N->isMachineOpcode()) {
242     return NULL;   // Already selected.
243   }
244
245   switch (N->getOpcode()) {
246   default: break;
247   case AlphaISD::CALL:
248     SelectCALL(Op);
249     return NULL;
250
251   case ISD::FrameIndex: {
252     int FI = cast<FrameIndexSDNode>(N)->getIndex();
253     return CurDAG->SelectNodeTo(N, Alpha::LDA, MVT::i64,
254                                 CurDAG->getTargetFrameIndex(FI, MVT::i32),
255                                 getI64Imm(0));
256   }
257   case ISD::GLOBAL_OFFSET_TABLE: {
258     SDValue Result = getGlobalBaseReg();
259     ReplaceUses(Op, Result);
260     return NULL;
261   }
262   case AlphaISD::GlobalRetAddr: {
263     SDValue Result = getGlobalRetAddr();
264     ReplaceUses(Op, Result);
265     return NULL;
266   }
267   
268   case AlphaISD::DivCall: {
269     SDValue Chain = CurDAG->getEntryNode();
270     SDValue N0 = Op.getOperand(0);
271     SDValue N1 = Op.getOperand(1);
272     SDValue N2 = Op.getOperand(2);
273     AddToISelQueue(N0);
274     AddToISelQueue(N1);
275     AddToISelQueue(N2);
276     Chain = CurDAG->getCopyToReg(Chain, Alpha::R24, N1, 
277                                  SDValue(0,0));
278     Chain = CurDAG->getCopyToReg(Chain, Alpha::R25, N2, 
279                                  Chain.getValue(1));
280     Chain = CurDAG->getCopyToReg(Chain, Alpha::R27, N0, 
281                                  Chain.getValue(1));
282     SDNode *CNode =
283       CurDAG->getTargetNode(Alpha::JSRs, MVT::Other, MVT::Flag, 
284                             Chain, Chain.getValue(1));
285     Chain = CurDAG->getCopyFromReg(Chain, Alpha::R27, MVT::i64, 
286                                    SDValue(CNode, 1));
287     return CurDAG->SelectNodeTo(N, Alpha::BISr, MVT::i64, Chain, Chain);
288   }
289
290   case ISD::READCYCLECOUNTER: {
291     SDValue Chain = N->getOperand(0);
292     AddToISelQueue(Chain); //Select chain
293     return CurDAG->getTargetNode(Alpha::RPCC, MVT::i64, MVT::Other,
294                                  Chain);
295   }
296
297   case ISD::Constant: {
298     uint64_t uval = cast<ConstantSDNode>(N)->getZExtValue();
299     
300     if (uval == 0) {
301       SDValue Result = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
302                                                 Alpha::R31, MVT::i64);
303       ReplaceUses(Op, Result);
304       return NULL;
305     }
306
307     int64_t val = (int64_t)uval;
308     int32_t val32 = (int32_t)val;
309     if (val <= IMM_HIGH + IMM_HIGH * IMM_MULT &&
310         val >= IMM_LOW  + IMM_LOW  * IMM_MULT)
311       break; //(LDAH (LDA))
312     if ((uval >> 32) == 0 && //empty upper bits
313         val32 <= IMM_HIGH + IMM_HIGH * IMM_MULT)
314       // val32 >= IMM_LOW  + IMM_LOW  * IMM_MULT) //always true
315       break; //(zext (LDAH (LDA)))
316     //Else use the constant pool
317     ConstantInt *C = ConstantInt::get(Type::Int64Ty, uval);
318     SDValue CPI = CurDAG->getTargetConstantPool(C, MVT::i64);
319     SDNode *Tmp = CurDAG->getTargetNode(Alpha::LDAHr, MVT::i64, CPI,
320                                         getGlobalBaseReg());
321     return CurDAG->SelectNodeTo(N, Alpha::LDQr, MVT::i64, MVT::Other, 
322                                 CPI, SDValue(Tmp, 0), CurDAG->getEntryNode());
323   }
324   case ISD::TargetConstantFP:
325   case ISD::ConstantFP: {
326     ConstantFPSDNode *CN = cast<ConstantFPSDNode>(N);
327     bool isDouble = N->getValueType(0) == MVT::f64;
328     MVT T = isDouble ? MVT::f64 : MVT::f32;
329     if (CN->getValueAPF().isPosZero()) {
330       return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYST : Alpha::CPYSS,
331                                   T, CurDAG->getRegister(Alpha::F31, T),
332                                   CurDAG->getRegister(Alpha::F31, T));
333     } else if (CN->getValueAPF().isNegZero()) {
334       return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYSNT : Alpha::CPYSNS,
335                                   T, CurDAG->getRegister(Alpha::F31, T),
336                                   CurDAG->getRegister(Alpha::F31, T));
337     } else {
338       abort();
339     }
340     break;
341   }
342
343   case ISD::SETCC:
344     if (N->getOperand(0).getNode()->getValueType(0).isFloatingPoint()) {
345       ISD::CondCode CC = cast<CondCodeSDNode>(N->getOperand(2))->get();
346
347       unsigned Opc = Alpha::WTF;
348       bool rev = false;
349       bool inv = false;
350       switch(CC) {
351       default: DEBUG(N->dump(CurDAG)); assert(0 && "Unknown FP comparison!");
352       case ISD::SETEQ: case ISD::SETOEQ: case ISD::SETUEQ:
353         Opc = Alpha::CMPTEQ; break;
354       case ISD::SETLT: case ISD::SETOLT: case ISD::SETULT: 
355         Opc = Alpha::CMPTLT; break;
356       case ISD::SETLE: case ISD::SETOLE: case ISD::SETULE: 
357         Opc = Alpha::CMPTLE; break;
358       case ISD::SETGT: case ISD::SETOGT: case ISD::SETUGT: 
359         Opc = Alpha::CMPTLT; rev = true; break;
360       case ISD::SETGE: case ISD::SETOGE: case ISD::SETUGE: 
361         Opc = Alpha::CMPTLE; rev = true; break;
362       case ISD::SETNE: case ISD::SETONE: case ISD::SETUNE:
363         Opc = Alpha::CMPTEQ; inv = true; break;
364       case ISD::SETO:
365         Opc = Alpha::CMPTUN; inv = true; break;
366       case ISD::SETUO:
367         Opc = Alpha::CMPTUN; break;
368       };
369       SDValue tmp1 = N->getOperand(rev?1:0);
370       SDValue tmp2 = N->getOperand(rev?0:1);
371       AddToISelQueue(tmp1);
372       AddToISelQueue(tmp2);
373       SDNode *cmp = CurDAG->getTargetNode(Opc, MVT::f64, tmp1, tmp2);
374       if (inv) 
375         cmp = CurDAG->getTargetNode(Alpha::CMPTEQ, MVT::f64, SDValue(cmp, 0), 
376                                     CurDAG->getRegister(Alpha::F31, MVT::f64));
377       switch(CC) {
378       case ISD::SETUEQ: case ISD::SETULT: case ISD::SETULE:
379       case ISD::SETUNE: case ISD::SETUGT: case ISD::SETUGE:
380        {
381          SDNode* cmp2 = CurDAG->getTargetNode(Alpha::CMPTUN, MVT::f64,
382                                               tmp1, tmp2);
383          cmp = CurDAG->getTargetNode(Alpha::ADDT, MVT::f64, 
384                                      SDValue(cmp2, 0), SDValue(cmp, 0));
385          break;
386        }
387       default: break;
388       }
389
390       SDNode* LD = CurDAG->getTargetNode(Alpha::FTOIT, MVT::i64, SDValue(cmp, 0));
391       return CurDAG->getTargetNode(Alpha::CMPULT, MVT::i64, 
392                                    CurDAG->getRegister(Alpha::R31, MVT::i64),
393                                    SDValue(LD,0));
394     }
395     break;
396
397   case ISD::SELECT:
398     if (N->getValueType(0).isFloatingPoint() &&
399         (N->getOperand(0).getOpcode() != ISD::SETCC ||
400          !N->getOperand(0).getOperand(1).getValueType().isFloatingPoint())) {
401       //This should be the condition not covered by the Patterns
402       //FIXME: Don't have SelectCode die, but rather return something testable
403       // so that things like this can be caught in fall though code
404       //move int to fp
405       bool isDouble = N->getValueType(0) == MVT::f64;
406       SDValue cond = N->getOperand(0);
407       SDValue TV = N->getOperand(1);
408       SDValue FV = N->getOperand(2);
409       AddToISelQueue(cond);
410       AddToISelQueue(TV);
411       AddToISelQueue(FV);
412       
413       SDNode* LD = CurDAG->getTargetNode(Alpha::ITOFT, MVT::f64, cond);
414       return CurDAG->getTargetNode(isDouble?Alpha::FCMOVNET:Alpha::FCMOVNES,
415                                    MVT::f64, FV, TV, SDValue(LD,0));
416     }
417     break;
418
419   case ISD::AND: {
420     ConstantSDNode* SC = NULL;
421     ConstantSDNode* MC = NULL;
422     if (N->getOperand(0).getOpcode() == ISD::SRL &&
423         (MC = dyn_cast<ConstantSDNode>(N->getOperand(1))) &&
424         (SC = dyn_cast<ConstantSDNode>(N->getOperand(0).getOperand(1)))) {
425       uint64_t sval = SC->getZExtValue();
426       uint64_t mval = MC->getZExtValue();
427       // If the result is a zap, let the autogened stuff handle it.
428       if (get_zapImm(N->getOperand(0), mval))
429         break;
430       // given mask X, and shift S, we want to see if there is any zap in the
431       // mask if we play around with the botton S bits
432       uint64_t dontcare = (~0ULL) >> (64 - sval);
433       uint64_t mask = mval << sval;
434       
435       if (get_zapImm(mask | dontcare))
436         mask = mask | dontcare;
437       
438       if (get_zapImm(mask)) {
439         AddToISelQueue(N->getOperand(0).getOperand(0));
440         SDValue Z = 
441           SDValue(CurDAG->getTargetNode(Alpha::ZAPNOTi, MVT::i64,
442                                           N->getOperand(0).getOperand(0),
443                                           getI64Imm(get_zapImm(mask))), 0);
444         return CurDAG->getTargetNode(Alpha::SRLr, MVT::i64, Z, 
445                                      getI64Imm(sval));
446       }
447     }
448     break;
449   }
450
451   }
452
453   return SelectCode(Op);
454 }
455
456 void AlphaDAGToDAGISel::SelectCALL(SDValue Op) {
457   //TODO: add flag stuff to prevent nondeturministic breakage!
458
459   SDNode *N = Op.getNode();
460   SDValue Chain = N->getOperand(0);
461   SDValue Addr = N->getOperand(1);
462   SDValue InFlag(0,0);  // Null incoming flag value.
463   AddToISelQueue(Chain);
464
465    std::vector<SDValue> CallOperands;
466    std::vector<MVT> TypeOperands;
467   
468    //grab the arguments
469    for(int i = 2, e = N->getNumOperands(); i < e; ++i) {
470      TypeOperands.push_back(N->getOperand(i).getValueType());
471      AddToISelQueue(N->getOperand(i));
472      CallOperands.push_back(N->getOperand(i));
473    }
474    int count = N->getNumOperands() - 2;
475
476    static const unsigned args_int[] = {Alpha::R16, Alpha::R17, Alpha::R18,
477                                        Alpha::R19, Alpha::R20, Alpha::R21};
478    static const unsigned args_float[] = {Alpha::F16, Alpha::F17, Alpha::F18,
479                                          Alpha::F19, Alpha::F20, Alpha::F21};
480    
481    for (int i = 6; i < count; ++i) {
482      unsigned Opc = Alpha::WTF;
483      if (TypeOperands[i].isInteger()) {
484        Opc = Alpha::STQ;
485      } else if (TypeOperands[i] == MVT::f32) {
486        Opc = Alpha::STS;
487      } else if (TypeOperands[i] == MVT::f64) {
488        Opc = Alpha::STT;
489      } else
490        assert(0 && "Unknown operand"); 
491
492      SDValue Ops[] = { CallOperands[i],  getI64Imm((i - 6) * 8), 
493                          CurDAG->getCopyFromReg(Chain, Alpha::R30, MVT::i64),
494                          Chain };
495      Chain = SDValue(CurDAG->getTargetNode(Opc, MVT::Other, Ops, 4), 0);
496    }
497    for (int i = 0; i < std::min(6, count); ++i) {
498      if (TypeOperands[i].isInteger()) {
499        Chain = CurDAG->getCopyToReg(Chain, args_int[i], CallOperands[i], InFlag);
500        InFlag = Chain.getValue(1);
501      } else if (TypeOperands[i] == MVT::f32 || TypeOperands[i] == MVT::f64) {
502        Chain = CurDAG->getCopyToReg(Chain, args_float[i], CallOperands[i], InFlag);
503        InFlag = Chain.getValue(1);
504      } else
505        assert(0 && "Unknown operand"); 
506    }
507
508    // Finally, once everything is in registers to pass to the call, emit the
509    // call itself.
510    if (Addr.getOpcode() == AlphaISD::GPRelLo) {
511      SDValue GOT = getGlobalBaseReg();
512      Chain = CurDAG->getCopyToReg(Chain, Alpha::R29, GOT, InFlag);
513      InFlag = Chain.getValue(1);
514      Chain = SDValue(CurDAG->getTargetNode(Alpha::BSR, MVT::Other, MVT::Flag, 
515                                              Addr.getOperand(0), Chain, InFlag), 0);
516    } else {
517      AddToISelQueue(Addr);
518      Chain = CurDAG->getCopyToReg(Chain, Alpha::R27, Addr, InFlag);
519      InFlag = Chain.getValue(1);
520      Chain = SDValue(CurDAG->getTargetNode(Alpha::JSR, MVT::Other, MVT::Flag, 
521                                              Chain, InFlag), 0);
522    }
523    InFlag = Chain.getValue(1);
524
525    std::vector<SDValue> CallResults;
526   
527    switch (N->getValueType(0).getSimpleVT()) {
528    default: assert(0 && "Unexpected ret value!");
529      case MVT::Other: break;
530    case MVT::i64:
531      Chain = CurDAG->getCopyFromReg(Chain, Alpha::R0, MVT::i64, InFlag).getValue(1);
532      CallResults.push_back(Chain.getValue(0));
533      break;
534    case MVT::f32:
535      Chain = CurDAG->getCopyFromReg(Chain, Alpha::F0, MVT::f32, InFlag).getValue(1);
536      CallResults.push_back(Chain.getValue(0));
537      break;
538    case MVT::f64:
539      Chain = CurDAG->getCopyFromReg(Chain, Alpha::F0, MVT::f64, InFlag).getValue(1);
540      CallResults.push_back(Chain.getValue(0));
541      break;
542    }
543
544    CallResults.push_back(Chain);
545    for (unsigned i = 0, e = CallResults.size(); i != e; ++i)
546      ReplaceUses(Op.getValue(i), CallResults[i]);
547 }
548
549
550 /// createAlphaISelDag - This pass converts a legalized DAG into a 
551 /// Alpha-specific DAG, ready for instruction scheduling.
552 ///
553 FunctionPass *llvm::createAlphaISelDag(AlphaTargetMachine &TM) {
554   return new AlphaDAGToDAGISel(TM);
555 }