mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-23 20:29:30 +00:00
Use MVC for memcpy in cases where a single MVC is enough. Using MVC is a win for longer copies too, but I'll leave that for later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185802 91177308-0d34-0410-b5e6-96231b3b80d8
47 lines
1.5 KiB
C++
47 lines
1.5 KiB
C++
//===-- SystemZSelectionDAGInfo.cpp - SystemZ SelectionDAG Info -----------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file implements the SystemZSelectionDAGInfo class.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#define DEBUG_TYPE "systemz-selectiondag-info"
|
|
#include "SystemZTargetMachine.h"
|
|
#include "llvm/CodeGen/SelectionDAG.h"
|
|
|
|
using namespace llvm;
|
|
|
|
SystemZSelectionDAGInfo::
|
|
SystemZSelectionDAGInfo(const SystemZTargetMachine &TM)
|
|
: TargetSelectionDAGInfo(TM) {
|
|
}
|
|
|
|
SystemZSelectionDAGInfo::~SystemZSelectionDAGInfo() {
|
|
}
|
|
|
|
SDValue SystemZSelectionDAGInfo::
|
|
EmitTargetCodeForMemcpy(SelectionDAG &DAG, SDLoc DL, SDValue Chain,
|
|
SDValue Dst, SDValue Src, SDValue Size, unsigned Align,
|
|
bool IsVolatile, bool AlwaysInline,
|
|
MachinePointerInfo DstPtrInfo,
|
|
MachinePointerInfo SrcPtrInfo) const {
|
|
if (IsVolatile)
|
|
return SDValue();
|
|
|
|
if (ConstantSDNode *CSize = dyn_cast<ConstantSDNode>(Size)) {
|
|
uint64_t Bytes = CSize->getZExtValue();
|
|
if (Bytes >= 1 && Bytes <= 0x100) {
|
|
// A single MVC.
|
|
return DAG.getNode(SystemZISD::MVC, DL, MVT::Other,
|
|
Chain, Dst, Src, Size);
|
|
}
|
|
}
|
|
return SDValue();
|
|
}
|