1 //==-- llvm/Target/TargetSelectionDAGInfo.h - SelectionDAG Info --*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the TargetSelectionDAGInfo class, which targets can
11 // subclass to parameterize the SelectionDAG lowering and instruction
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_TARGET_TARGETSELECTIONDAGINFO_H
17 #define LLVM_TARGET_TARGETSELECTIONDAGINFO_H
19 #include "llvm/CodeGen/SelectionDAGNodes.h"
26 //===----------------------------------------------------------------------===//
27 /// TargetSelectionDAGInfo - Targets can subclass this to parameterize the
28 /// SelectionDAG lowering and instruction selection process.
30 class TargetSelectionDAGInfo {
31 TargetSelectionDAGInfo(const TargetSelectionDAGInfo &); // DO NOT IMPLEMENT
32 void operator=(const TargetSelectionDAGInfo &); // DO NOT IMPLEMENT
37 const TargetData *getTargetData() const { return TD; }
40 explicit TargetSelectionDAGInfo(const TargetMachine &TM);
41 virtual ~TargetSelectionDAGInfo();
43 /// EmitTargetCodeForMemcpy - Emit target-specific code that performs a
44 /// memcpy. This can be used by targets to provide code sequences for cases
45 /// that don't fit the target's parameters for simple loads/stores and can be
46 /// more efficient than using a library call. This function can return a null
47 /// SDValue if the target declines to use custom code and a different
48 /// lowering strategy should be used.
50 /// If AlwaysInline is true, the size is constant and the target should not
51 /// emit any calls and is strongly encouraged to attempt to emit inline code
52 /// even if it is beyond the usual threshold because this intrinsic is being
53 /// expanded in a place where calls are not feasible (e.g. within the prologue
54 /// for another call). If the target chooses to decline an AlwaysInline
55 /// request here, legalize will resort to using simple loads and stores.
57 EmitTargetCodeForMemcpy(SelectionDAG &DAG, DebugLoc dl,
59 SDValue Op1, SDValue Op2,
60 SDValue Op3, unsigned Align, bool isVolatile,
62 MachinePointerInfo DstPtrInfo,
63 MachinePointerInfo SrcPtrInfo) const {
67 /// EmitTargetCodeForMemmove - Emit target-specific code that performs a
68 /// memmove. This can be used by targets to provide code sequences for cases
69 /// that don't fit the target's parameters for simple loads/stores and can be
70 /// more efficient than using a library call. This function can return a null
71 /// SDValue if the target declines to use custom code and a different
72 /// lowering strategy should be used.
74 EmitTargetCodeForMemmove(SelectionDAG &DAG, DebugLoc dl,
76 SDValue Op1, SDValue Op2,
77 SDValue Op3, unsigned Align, bool isVolatile,
78 MachinePointerInfo DstPtrInfo,
79 MachinePointerInfo SrcPtrInfo) const {
83 /// EmitTargetCodeForMemset - Emit target-specific code that performs a
84 /// memset. This can be used by targets to provide code sequences for cases
85 /// that don't fit the target's parameters for simple stores and can be more
86 /// efficient than using a library call. This function can return a null
87 /// SDValue if the target declines to use custom code and a different
88 /// lowering strategy should be used.
90 EmitTargetCodeForMemset(SelectionDAG &DAG, DebugLoc dl,
92 SDValue Op1, SDValue Op2,
93 SDValue Op3, unsigned Align, bool isVolatile,
94 MachinePointerInfo DstPtrInfo) const {
99 } // end llvm namespace