WebAssemblyInstrInfo.h revision 296417
1285163Sdim//=- WebAssemblyInstrInfo.h - WebAssembly Instruction Information -*- C++ -*-=//
2285163Sdim//
3285163Sdim//                     The LLVM Compiler Infrastructure
4285163Sdim//
5285163Sdim// This file is distributed under the University of Illinois Open Source
6285163Sdim// License. See LICENSE.TXT for details.
7285163Sdim//
8285163Sdim//===----------------------------------------------------------------------===//
9285163Sdim///
10285163Sdim/// \file
11285163Sdim/// \brief This file contains the WebAssembly implementation of the
12285163Sdim/// TargetInstrInfo class.
13285163Sdim///
14285163Sdim//===----------------------------------------------------------------------===//
15285163Sdim
16285163Sdim#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYINSTRINFO_H
17285163Sdim#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYINSTRINFO_H
18285163Sdim
19285163Sdim#include "WebAssemblyRegisterInfo.h"
20285163Sdim#include "llvm/Target/TargetInstrInfo.h"
21285163Sdim
22296417Sdim#define GET_INSTRINFO_HEADER
23296417Sdim#include "WebAssemblyGenInstrInfo.inc"
24296417Sdim
25285163Sdimnamespace llvm {
26285163Sdim
27285163Sdimclass WebAssemblySubtarget;
28285163Sdim
29296417Sdimclass WebAssemblyInstrInfo final : public WebAssemblyGenInstrInfo {
30285163Sdim  const WebAssemblyRegisterInfo RI;
31285163Sdim
32285163Sdimpublic:
33285163Sdim  explicit WebAssemblyInstrInfo(const WebAssemblySubtarget &STI);
34285163Sdim
35285163Sdim  const WebAssemblyRegisterInfo &getRegisterInfo() const { return RI; }
36296417Sdim
37296417Sdim  void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
38296417Sdim                   DebugLoc DL, unsigned DestReg, unsigned SrcReg,
39296417Sdim                   bool KillSrc) const override;
40296417Sdim
41296417Sdim  bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
42296417Sdim                     MachineBasicBlock *&FBB,
43296417Sdim                     SmallVectorImpl<MachineOperand> &Cond,
44296417Sdim                     bool AllowModify = false) const override;
45296417Sdim  unsigned RemoveBranch(MachineBasicBlock &MBB) const override;
46296417Sdim  unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
47296417Sdim                        MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
48296417Sdim                        DebugLoc DL) const override;
49296417Sdim  bool
50296417Sdim  ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
51285163Sdim};
52285163Sdim
53285163Sdim} // end namespace llvm
54285163Sdim
55285163Sdim#endif
56