Make ModRefBehavior a lattice. Use this to clean up AliasAnalysis
[oota-llvm.git] / lib / Target / PTX / PTXISelDAGToDAG.cpp
1 //===-- PTXISelDAGToDAG.cpp - A dag to dag inst selector for PTX ----------===//
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 an instruction selector for the PTX target.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "PTX.h"
15 #include "PTXTargetMachine.h"
16 #include "llvm/CodeGen/SelectionDAGISel.h"
17
18 using namespace llvm;
19
20 namespace {
21 // PTXDAGToDAGISel - PTX specific code to select PTX machine
22 // instructions for SelectionDAG operations.
23 class PTXDAGToDAGISel : public SelectionDAGISel {
24   public:
25     PTXDAGToDAGISel(PTXTargetMachine &TM, CodeGenOpt::Level OptLevel);
26
27     virtual const char *getPassName() const {
28       return "PTX DAG->DAG Pattern Instruction Selection";
29     }
30
31     SDNode *Select(SDNode *Node);
32
33     // Include the pieces auto'gened from the target description
34 #include "PTXGenDAGISel.inc"
35
36 }; // class PTXDAGToDAGISel
37 } // namespace
38
39 // createPTXISelDag - This pass converts a legalized DAG into a
40 // PTX-specific DAG, ready for instruction scheduling
41 FunctionPass *llvm::createPTXISelDag(PTXTargetMachine &TM,
42                                      CodeGenOpt::Level OptLevel) {
43   return new PTXDAGToDAGISel(TM, OptLevel);
44 }
45
46 PTXDAGToDAGISel::PTXDAGToDAGISel(PTXTargetMachine &TM,
47                                  CodeGenOpt::Level OptLevel)
48   : SelectionDAGISel(TM, OptLevel) {}
49
50 SDNode *PTXDAGToDAGISel::Select(SDNode *Node) {
51   // SelectCode() is auto'gened
52   return SelectCode(Node);
53 }