blob: 5ddd9b36f2433e225eebc04190b1df5b271661b9 [file] [log] [blame]
Dan Gohman10e730a2015-06-29 23:51:55 +00001//=- WebAssemblyInstrInfo.h - WebAssembly Instruction Information -*- C++ -*-=//
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#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYINSTRINFO_H
17#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYINSTRINFO_H
18
19#include "WebAssemblyRegisterInfo.h"
20#include "llvm/Target/TargetInstrInfo.h"
21
JF Bastienb9073fb2015-07-22 21:28:15 +000022#define GET_INSTRINFO_HEADER
23#include "WebAssemblyGenInstrInfo.inc"
24
Dan Gohman10e730a2015-06-29 23:51:55 +000025namespace llvm {
26
27class WebAssemblySubtarget;
28
JF Bastienb9073fb2015-07-22 21:28:15 +000029class WebAssemblyInstrInfo final : public WebAssemblyGenInstrInfo {
Dan Gohman10e730a2015-06-29 23:51:55 +000030 const WebAssemblyRegisterInfo RI;
31
32public:
33 explicit WebAssemblyInstrInfo(const WebAssemblySubtarget &STI);
34
35 const WebAssemblyRegisterInfo &getRegisterInfo() const { return RI; }
Dan Gohman4f52e002015-09-09 00:52:47 +000036
37 void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
38 DebugLoc DL, unsigned DestReg, unsigned SrcReg,
39 bool KillSrc) const override;
Dan Gohman950a13c2015-09-16 16:51:30 +000040
41 bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
42 MachineBasicBlock *&FBB,
43 SmallVectorImpl<MachineOperand> &Cond,
44 bool AllowModify = false) const override;
45 unsigned RemoveBranch(MachineBasicBlock &MBB) const override;
46 unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
Dan Gohman7a6b9822015-11-29 22:32:02 +000047 MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
Dan Gohman950a13c2015-09-16 16:51:30 +000048 DebugLoc DL) const override;
49 bool
50 ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
Dan Gohman10e730a2015-06-29 23:51:55 +000051};
52
53} // end namespace llvm
54
55#endif