LLVM API Documentation
00001 //==-- llvm/Target/TargetSelectionDAGInfo.h - SelectionDAG Info --*- C++ -*-==// 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 declares the TargetSelectionDAGInfo class, which targets can 00011 // subclass to parameterize the SelectionDAG lowering and instruction 00012 // selection process. 00013 // 00014 //===----------------------------------------------------------------------===// 00015 00016 #ifndef LLVM_TARGET_TARGETSELECTIONDAGINFO_H 00017 #define LLVM_TARGET_TARGETSELECTIONDAGINFO_H 00018 00019 #include "llvm/CodeGen/SelectionDAGNodes.h" 00020 00021 namespace llvm { 00022 00023 class DataLayout; 00024 class TargetMachine; 00025 00026 //===----------------------------------------------------------------------===// 00027 /// TargetSelectionDAGInfo - Targets can subclass this to parameterize the 00028 /// SelectionDAG lowering and instruction selection process. 00029 /// 00030 class TargetSelectionDAGInfo { 00031 TargetSelectionDAGInfo(const TargetSelectionDAGInfo &) LLVM_DELETED_FUNCTION; 00032 void operator=(const TargetSelectionDAGInfo &) LLVM_DELETED_FUNCTION; 00033 00034 const DataLayout *TD; 00035 00036 protected: 00037 const DataLayout *getDataLayout() const { return TD; } 00038 00039 public: 00040 explicit TargetSelectionDAGInfo(const TargetMachine &TM); 00041 virtual ~TargetSelectionDAGInfo(); 00042 00043 /// EmitTargetCodeForMemcpy - Emit target-specific code that performs a 00044 /// memcpy. This can be used by targets to provide code sequences for cases 00045 /// that don't fit the target's parameters for simple loads/stores and can be 00046 /// more efficient than using a library call. This function can return a null 00047 /// SDValue if the target declines to use custom code and a different 00048 /// lowering strategy should be used. 00049 /// 00050 /// If AlwaysInline is true, the size is constant and the target should not 00051 /// emit any calls and is strongly encouraged to attempt to emit inline code 00052 /// even if it is beyond the usual threshold because this intrinsic is being 00053 /// expanded in a place where calls are not feasible (e.g. within the prologue 00054 /// for another call). If the target chooses to decline an AlwaysInline 00055 /// request here, legalize will resort to using simple loads and stores. 00056 virtual SDValue 00057 EmitTargetCodeForMemcpy(SelectionDAG &DAG, DebugLoc dl, 00058 SDValue Chain, 00059 SDValue Op1, SDValue Op2, 00060 SDValue Op3, unsigned Align, bool isVolatile, 00061 bool AlwaysInline, 00062 MachinePointerInfo DstPtrInfo, 00063 MachinePointerInfo SrcPtrInfo) const { 00064 return SDValue(); 00065 } 00066 00067 /// EmitTargetCodeForMemmove - Emit target-specific code that performs a 00068 /// memmove. This can be used by targets to provide code sequences for cases 00069 /// that don't fit the target's parameters for simple loads/stores and can be 00070 /// more efficient than using a library call. This function can return a null 00071 /// SDValue if the target declines to use custom code and a different 00072 /// lowering strategy should be used. 00073 virtual SDValue 00074 EmitTargetCodeForMemmove(SelectionDAG &DAG, DebugLoc dl, 00075 SDValue Chain, 00076 SDValue Op1, SDValue Op2, 00077 SDValue Op3, unsigned Align, bool isVolatile, 00078 MachinePointerInfo DstPtrInfo, 00079 MachinePointerInfo SrcPtrInfo) const { 00080 return SDValue(); 00081 } 00082 00083 /// EmitTargetCodeForMemset - Emit target-specific code that performs a 00084 /// memset. This can be used by targets to provide code sequences for cases 00085 /// that don't fit the target's parameters for simple stores and can be more 00086 /// efficient than using a library call. This function can return a null 00087 /// SDValue if the target declines to use custom code and a different 00088 /// lowering strategy should be used. 00089 virtual SDValue 00090 EmitTargetCodeForMemset(SelectionDAG &DAG, DebugLoc dl, 00091 SDValue Chain, 00092 SDValue Op1, SDValue Op2, 00093 SDValue Op3, unsigned Align, bool isVolatile, 00094 MachinePointerInfo DstPtrInfo) const { 00095 return SDValue(); 00096 } 00097 }; 00098 00099 } // end llvm namespace 00100 00101 #endif