1 //===-- HexagonSelectionDAGInfo.cpp - Hexagon SelectionDAG Info -----------===//
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 implements the HexagonSelectionDAGInfo class.
12 //===----------------------------------------------------------------------===//
14 #include "HexagonTargetMachine.h"
17 #define DEBUG_TYPE "hexagon-selectiondag-info"
19 bool llvm::flag_aligned_memcpy;
21 HexagonSelectionDAGInfo::HexagonSelectionDAGInfo(const HexagonTargetMachine
23 : TargetSelectionDAGInfo(TM) {
26 HexagonSelectionDAGInfo::~HexagonSelectionDAGInfo() {
30 HexagonSelectionDAGInfo::
31 EmitTargetCodeForMemcpy(SelectionDAG &DAG, SDLoc dl, SDValue Chain,
32 SDValue Dst, SDValue Src, SDValue Size, unsigned Align,
33 bool isVolatile, bool AlwaysInline,
34 MachinePointerInfo DstPtrInfo,
35 MachinePointerInfo SrcPtrInfo) const {
36 flag_aligned_memcpy = false;
37 if ((Align & 0x3) == 0) {
38 ConstantSDNode *ConstantSize = dyn_cast<ConstantSDNode>(Size);
40 uint64_t SizeVal = ConstantSize->getZExtValue();
41 if ((SizeVal > 32) && ((SizeVal % 8) == 0))
42 flag_aligned_memcpy = true;