1cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar//=- WebAssemblyInstrInfo.h - WebAssembly Instruction Information -*- C++ -*-=// 2cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// 3cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// The LLVM Compiler Infrastructure 4cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// 5cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// This file is distributed under the University of Illinois Open Source 6cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// License. See LICENSE.TXT for details. 7cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// 8cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar//===----------------------------------------------------------------------===// 9cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar/// 10cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar/// \file 11cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar/// \brief This file contains the WebAssembly implementation of the 12cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar/// TargetInstrInfo class. 13cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar/// 14cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar//===----------------------------------------------------------------------===// 15cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar 16cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYINSTRINFO_H 17cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYINSTRINFO_H 18cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar 19cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar#include "WebAssemblyRegisterInfo.h" 20cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar#include "llvm/Target/TargetInstrInfo.h" 21cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar 22cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar#define GET_INSTRINFO_HEADER 23cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar#include "WebAssemblyGenInstrInfo.inc" 24cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar 25cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainarnamespace llvm { 26cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar 27cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainarclass WebAssemblySubtarget; 28cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar 29cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainarclass WebAssemblyInstrInfo final : public WebAssemblyGenInstrInfo { 30cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar const WebAssemblyRegisterInfo RI; 31cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar 32cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainarpublic: 33cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar explicit WebAssemblyInstrInfo(const WebAssemblySubtarget &STI); 34cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar 35cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar const WebAssemblyRegisterInfo &getRegisterInfo() const { return RI; } 36cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar 37cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, 38cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar DebugLoc DL, unsigned DestReg, unsigned SrcReg, 39cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar bool KillSrc) const override; 40cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar 41cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, 42cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar MachineBasicBlock *&FBB, 43cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar SmallVectorImpl<MachineOperand> &Cond, 44cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar bool AllowModify = false) const override; 45cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar unsigned RemoveBranch(MachineBasicBlock &MBB) const override; 46cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, 47cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond, 48cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar DebugLoc DL) const override; 49cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar bool 50cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override; 51cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar}; 52cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar 53cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar} // end namespace llvm 54cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar 55cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar#endif 56