1 //===-- WebAssemblySelectionDAGInfo.cpp - WebAssembly SelectionDAG Info ---===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// This file implements the WebAssemblySelectionDAGInfo class.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #include "WebAssemblyTargetMachine.h"
15 using namespace llvm;
16 
17 #define DEBUG_TYPE "wasm-selectiondag-info"
18 
19 WebAssemblySelectionDAGInfo::~WebAssemblySelectionDAGInfo() = default; // anchor
20 
21 SDValue WebAssemblySelectionDAGInfo::EmitTargetCodeForMemcpy(
22     SelectionDAG &DAG, const SDLoc &DL, SDValue Chain, SDValue Op1, SDValue Op2,
23     SDValue Op3, unsigned Align, bool isVolatile, bool AlwaysInline,
24     MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo) const {
25   if (!DAG.getMachineFunction()
26            .getSubtarget<WebAssemblySubtarget>()
27            .hasBulkMemory())
28     return SDValue();
29 
30   return DAG.getNode(WebAssemblyISD::MEMORY_COPY, DL, MVT::Other, Chain, Op1,
31                      Op2, Op3);
32 }
33