LCOV - code coverage report
Current view: top level - lib/Target/AArch64 - AArch64SelectionDAGInfo.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 27 27 100.0 %
Date: 2017-09-14 15:23:50 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : 
      19          21 : SDValue AArch64SelectionDAGInfo::EmitTargetCodeForMemset(
      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.
      24          21 :   ConstantSDNode *V = dyn_cast<ConstantSDNode>(Src);
      25          21 :   ConstantSDNode *SizeValue = dyn_cast<ConstantSDNode>(Size);
      26             :   const AArch64Subtarget &STI =
      27          21 :       DAG.getMachineFunction().getSubtarget<AArch64Subtarget>();
      28             :   const char *bzeroEntry =
      29          41 :       (V && V->isNullValue()) ? STI.getBZeroEntry() : nullptr;
      30             :   // For small size (< 256), it is not beneficial to use bzero
      31             :   // instead of memset.
      32          18 :   if (bzeroEntry && (!SizeValue || SizeValue->getZExtValue() > 256)) {
      33           5 :     const AArch64TargetLowering &TLI = *STI.getTargetLowering();
      34             : 
      35          20 :     EVT IntPtr = TLI.getPointerTy(DAG.getDataLayout());
      36          10 :     Type *IntPtrTy = DAG.getDataLayout().getIntPtrType(*DAG.getContext());
      37          10 :     TargetLowering::ArgListTy Args;
      38           5 :     TargetLowering::ArgListEntry Entry;
      39           5 :     Entry.Node = Dst;
      40           5 :     Entry.Ty = IntPtrTy;
      41           5 :     Args.push_back(Entry);
      42           5 :     Entry.Node = Size;
      43           5 :     Args.push_back(Entry);
      44          10 :     TargetLowering::CallLoweringInfo CLI(DAG);
      45           5 :     CLI.setDebugLoc(dl)
      46           5 :         .setChain(Chain)
      47           5 :         .setLibCallee(CallingConv::C, Type::getVoidTy(*DAG.getContext()),
      48             :                       DAG.getExternalSymbol(bzeroEntry, IntPtr),
      49          10 :                       std::move(Args))
      50           5 :         .setDiscardResult();
      51           5 :     std::pair<SDValue, SDValue> CallResult = TLI.LowerCallTo(CLI);
      52           5 :     return CallResult.second;
      53             :   }
      54          16 :   return SDValue();
      55             : }
      56         598 : bool AArch64SelectionDAGInfo::generateFMAsInMachineCombiner(
      57             :     CodeGenOpt::Level OptLevel) const {
      58         598 :   return OptLevel >= CodeGenOpt::Aggressive;
      59             : }

Generated by: LCOV version 1.13