Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 1 | //===-- WebAssemblyInstrInfo.cpp - WebAssembly Instruction Information ----===// |
| 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 | /// \file |
| 11 | /// \brief This file contains the WebAssembly implementation of the |
| 12 | /// TargetInstrInfo class. |
| 13 | /// |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #include "WebAssemblyInstrInfo.h" |
| 17 | #include "MCTargetDesc/WebAssemblyMCTargetDesc.h" |
| 18 | #include "WebAssemblySubtarget.h" |
| 19 | #include "llvm/CodeGen/MachineFrameInfo.h" |
| 20 | #include "llvm/CodeGen/MachineInstrBuilder.h" |
| 21 | #include "llvm/CodeGen/MachineMemOperand.h" |
| 22 | #include "llvm/CodeGen/MachineRegisterInfo.h" |
| 23 | using namespace llvm; |
| 24 | |
| 25 | #define DEBUG_TYPE "wasm-instr-info" |
| 26 | |
JF Bastien | b9073fb | 2015-07-22 21:28:15 +0000 | [diff] [blame] | 27 | #define GET_INSTRINFO_CTOR_DTOR |
| 28 | #include "WebAssemblyGenInstrInfo.inc" |
| 29 | |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 30 | WebAssemblyInstrInfo::WebAssemblyInstrInfo(const WebAssemblySubtarget &STI) |
| 31 | : RI(STI.getTargetTriple()) {} |
Dan Gohman | 4f52e00 | 2015-09-09 00:52:47 +0000 | [diff] [blame] | 32 | |
| 33 | void WebAssemblyInstrInfo::copyPhysReg(MachineBasicBlock &MBB, |
| 34 | MachineBasicBlock::iterator I, |
| 35 | DebugLoc DL, unsigned DestReg, |
| 36 | unsigned SrcReg, bool KillSrc) const { |
| 37 | BuildMI(MBB, I, DL, get(WebAssembly::COPY), DestReg) |
| 38 | .addReg(SrcReg, KillSrc ? RegState::Kill : 0); |
| 39 | } |