LLVM API Documentation
00001 //===-- PIC16ISelDAGToDAG.cpp - A dag to dag inst selector for PIC16 ------===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file defines an instruction selector for the PIC16 target. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #define DEBUG_TYPE "pic16-isel" 00015 00016 #include "PIC16.h" 00017 #include "PIC16ISelLowering.h" 00018 #include "PIC16RegisterInfo.h" 00019 #include "PIC16TargetMachine.h" 00020 #include "llvm/CodeGen/SelectionDAGISel.h" 00021 #include "llvm/Support/Compiler.h" 00022 #include "llvm/Intrinsics.h" 00023 using namespace llvm; 00024 00025 namespace { 00026 00027 class VISIBILITY_HIDDEN PIC16DAGToDAGISel : public SelectionDAGISel { 00028 00029 /// TM - Keep a reference to PIC16TargetMachine. 00030 PIC16TargetMachine &TM; 00031 00032 /// PIC16Lowering - This object fully describes how to lower LLVM code to an 00033 /// PIC16-specific SelectionDAG. 00034 PIC16TargetLowering PIC16Lowering; 00035 00036 public: 00037 explicit PIC16DAGToDAGISel(PIC16TargetMachine &tm) : 00038 SelectionDAGISel(tm), 00039 TM(tm), PIC16Lowering(*TM.getTargetLowering()) {} 00040 00041 // Pass Name 00042 virtual const char *getPassName() const { 00043 return "PIC16 DAG->DAG Pattern Instruction Selection"; 00044 } 00045 00046 virtual void InstructionSelect(); 00047 00048 private: 00049 // Include the pieces autogenerated from the target description. 00050 #include "PIC16GenDAGISel.inc" 00051 00052 SDNode *Select(SDValue N); 00053 00054 // Match direct address complex pattern. 00055 bool SelectDirectAddr(SDValue Op, SDValue N, SDValue &Address); 00056 00057 }; 00058 00059 } 00060