blob: 276cc69eed0fe49003dc679da2781c3815d2993e [file] [log] [blame]
Tony Linthicum1213a7a2011-12-12 21:14:40 +00001//===-- HexagonSelectionDAGInfo.cpp - Hexagon 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 HexagonSelectionDAGInfo class.
11//
12//===----------------------------------------------------------------------===//
13
Tony Linthicum1213a7a2011-12-12 21:14:40 +000014#include "HexagonTargetMachine.h"
15using namespace llvm;
16
Chandler Carruth84e68b22014-04-22 02:41:26 +000017#define DEBUG_TYPE "hexagon-selectiondag-info"
18
Tony Linthicum1213a7a2011-12-12 21:14:40 +000019bool llvm::flag_aligned_memcpy;
20
Tony Linthicum1213a7a2011-12-12 21:14:40 +000021SDValue
22HexagonSelectionDAGInfo::
Andrew Trickef9de2a2013-05-25 02:42:55 +000023EmitTargetCodeForMemcpy(SelectionDAG &DAG, SDLoc dl, SDValue Chain,
Tony Linthicum1213a7a2011-12-12 21:14:40 +000024 SDValue Dst, SDValue Src, SDValue Size, unsigned Align,
25 bool isVolatile, bool AlwaysInline,
26 MachinePointerInfo DstPtrInfo,
27 MachinePointerInfo SrcPtrInfo) const {
28 flag_aligned_memcpy = false;
29 if ((Align & 0x3) == 0) {
30 ConstantSDNode *ConstantSize = dyn_cast<ConstantSDNode>(Size);
31 if (ConstantSize) {
32 uint64_t SizeVal = ConstantSize->getZExtValue();
33 if ((SizeVal > 32) && ((SizeVal % 8) == 0))
34 flag_aligned_memcpy = true;
35 }
36 }
37
38 return SDValue();
39}