LLVM  6.0.0svn
AArch64SelectionDAGInfo.cpp
Go to the documentation of this file.
1 //===-- AArch64SelectionDAGInfo.cpp - AArch64 SelectionDAG Info -----------===//
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 implements the AArch64SelectionDAGInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "AArch64TargetMachine.h"
15 using namespace llvm;
16 
17 #define DEBUG_TYPE "aarch64-selectiondag-info"
18 
20  SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src,
21  SDValue Size, unsigned Align, bool isVolatile,
22  MachinePointerInfo DstPtrInfo) const {
23  // Check to see if there is a specialized entry-point for memory zeroing.
26  const AArch64Subtarget &STI =
28  const char *bzeroEntry =
29  (V && V->isNullValue()) ? STI.getBZeroEntry() : nullptr;
30  // For small size (< 256), it is not beneficial to use bzero
31  // instead of memset.
32  if (bzeroEntry && (!SizeValue || SizeValue->getZExtValue() > 256)) {
33  const AArch64TargetLowering &TLI = *STI.getTargetLowering();
34 
35  EVT IntPtr = TLI.getPointerTy(DAG.getDataLayout());
36  Type *IntPtrTy = DAG.getDataLayout().getIntPtrType(*DAG.getContext());
39  Entry.Node = Dst;
40  Entry.Ty = IntPtrTy;
41  Args.push_back(Entry);
42  Entry.Node = Size;
43  Args.push_back(Entry);
45  CLI.setDebugLoc(dl)
46  .setChain(Chain)
48  DAG.getExternalSymbol(bzeroEntry, IntPtr),
49  std::move(Args))
50  .setDiscardResult();
51  std::pair<SDValue, SDValue> CallResult = TLI.LowerCallTo(CLI);
52  return CallResult.second;
53  }
54  return SDValue();
55 }
57  CodeGenOpt::Level OptLevel) const {
58  return OptLevel >= CodeGenOpt::Aggressive;
59 }
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
CallLoweringInfo & setDebugLoc(const SDLoc &dl)
SDValue getExternalSymbol(const char *Sym, EVT VT)
CallLoweringInfo & setChain(SDValue InChain)
const DataLayout & getDataLayout() const
Definition: SelectionDAG.h:388
MachineFunction & getMachineFunction() const
Definition: SelectionDAG.h:385
C - The default llvm calling convention, compatible with C.
Definition: CallingConv.h:35
IntegerType * getIntPtrType(LLVMContext &C, unsigned AddressSpace=0) const
Returns an integer type with size at least as big as that of a pointer in the given address space...
Definition: DataLayout.cpp:702
MVT getPointerTy(const DataLayout &DL, uint32_t AS=0) const
Return the pointer type for the given address space, defaults to the pointer type from the data layou...
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
bool generateFMAsInMachineCombiner(CodeGenOpt::Level OptLevel) const override
static Type * getVoidTy(LLVMContext &C)
Definition: Type.cpp:161
std::vector< ArgListEntry > ArgListTy
Extended Value Type.
Definition: ValueTypes.h:34
This structure contains all information that is necessary for lowering calls.
This class contains a discriminated union of information about pointers in memory operands...
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
Definition: SelectionDAG.h:209
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
const char * getBZeroEntry() const
This function returns the name of a function which has an interface like the non-standard bzero funct...
SDValue EmitTargetCodeForMemset(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVolatile, MachinePointerInfo DstPtrInfo) const override
Emit target-specific code that performs a memset.
std::pair< SDValue, SDValue > LowerCallTo(CallLoweringInfo &CLI) const
This function lowers an abstract call to a function into an actual call.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
Definition: Casting.h:323
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
static bool isVolatile(Instruction *Inst)
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
LLVMContext * getContext() const
Definition: SelectionDAG.h:393
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
CallLoweringInfo & setLibCallee(CallingConv::ID CC, Type *ResultType, SDValue Target, ArgListTy &&ArgsList)