LLVM API Documentation

HexagonSelectionDAGInfo.cpp
Go to the documentation of this file.
00001 //===-- HexagonSelectionDAGInfo.cpp - Hexagon SelectionDAG Info -----------===//
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 implements the HexagonSelectionDAGInfo class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #include "HexagonTargetMachine.h"
00015 using namespace llvm;
00016 
00017 #define DEBUG_TYPE "hexagon-selectiondag-info"
00018 
00019 bool llvm::flag_aligned_memcpy;
00020 
00021 HexagonSelectionDAGInfo::HexagonSelectionDAGInfo(const DataLayout &DL)
00022     : TargetSelectionDAGInfo(&DL) {}
00023 
00024 HexagonSelectionDAGInfo::~HexagonSelectionDAGInfo() {
00025 }
00026 
00027 SDValue
00028 HexagonSelectionDAGInfo::
00029 EmitTargetCodeForMemcpy(SelectionDAG &DAG, SDLoc dl, SDValue Chain,
00030                         SDValue Dst, SDValue Src, SDValue Size, unsigned Align,
00031                         bool isVolatile, bool AlwaysInline,
00032                         MachinePointerInfo DstPtrInfo,
00033                         MachinePointerInfo SrcPtrInfo) const {
00034   flag_aligned_memcpy = false;
00035   if ((Align & 0x3) == 0) {
00036     ConstantSDNode *ConstantSize = dyn_cast<ConstantSDNode>(Size);
00037     if (ConstantSize) {
00038       uint64_t SizeVal = ConstantSize->getZExtValue();
00039       if ((SizeVal > 32) && ((SizeVal % 8) == 0))
00040         flag_aligned_memcpy = true;
00041     }
00042   }
00043 
00044   return SDValue();
00045 }