1 //=- WebAssemblyInstrInfo.h - WebAssembly Instruction Information -*- C++ -*-=//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief This file contains the WebAssembly implementation of the
12 /// TargetInstrInfo class.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYINSTRINFO_H
17 #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYINSTRINFO_H
19 #include "WebAssemblyRegisterInfo.h"
20 #include "llvm/Target/TargetInstrInfo.h"
22 #define GET_INSTRINFO_HEADER
23 #include "WebAssemblyGenInstrInfo.inc"
27 class WebAssemblySubtarget;
29 class WebAssemblyInstrInfo final : public WebAssemblyGenInstrInfo {
30 const WebAssemblyRegisterInfo RI;
33 explicit WebAssemblyInstrInfo(const WebAssemblySubtarget &STI);
35 const WebAssemblyRegisterInfo &getRegisterInfo() const { return RI; }
37 void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
38 DebugLoc DL, unsigned DestReg, unsigned SrcReg,
39 bool KillSrc) const override;
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,
47 MachineBasicBlock *FBB,
48 ArrayRef<MachineOperand> Cond,
49 DebugLoc DL) const override;
51 ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
54 } // end namespace llvm