Path: blob/main/contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.h
35269 views
//=- WebAssemblyInstrInfo.h - WebAssembly Instruction Information -*- C++ -*-=//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7///8/// \file9/// This file contains the WebAssembly implementation of the10/// TargetInstrInfo class.11///12//===----------------------------------------------------------------------===//1314#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYINSTRINFO_H15#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYINSTRINFO_H1617#include "WebAssemblyRegisterInfo.h"18#include "llvm/ADT/ArrayRef.h"19#include "llvm/CodeGen/TargetInstrInfo.h"2021#define GET_INSTRINFO_HEADER22#include "WebAssemblyGenInstrInfo.inc"2324#define GET_INSTRINFO_OPERAND_ENUM25#include "WebAssemblyGenInstrInfo.inc"2627namespace llvm {2829namespace WebAssembly {3031int16_t getNamedOperandIdx(uint16_t Opcode, uint16_t NamedIndex);3233}3435class WebAssemblySubtarget;3637class WebAssemblyInstrInfo final : public WebAssemblyGenInstrInfo {38const WebAssemblyRegisterInfo RI;3940public:41explicit WebAssemblyInstrInfo(const WebAssemblySubtarget &STI);4243const WebAssemblyRegisterInfo &getRegisterInfo() const { return RI; }4445bool isReallyTriviallyReMaterializable(const MachineInstr &MI) const override;4647void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,48const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,49bool KillSrc) const override;50MachineInstr *commuteInstructionImpl(MachineInstr &MI, bool NewMI,51unsigned OpIdx1,52unsigned OpIdx2) const override;5354bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,55MachineBasicBlock *&FBB,56SmallVectorImpl<MachineOperand> &Cond,57bool AllowModify = false) const override;58unsigned removeBranch(MachineBasicBlock &MBB,59int *BytesRemoved = nullptr) const override;60unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,61MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,62const DebugLoc &DL,63int *BytesAdded = nullptr) const override;64bool65reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;6667ArrayRef<std::pair<int, const char *>>68getSerializableTargetIndices() const override;6970const MachineOperand &getCalleeOperand(const MachineInstr &MI) const override;7172bool isExplicitTargetIndexDef(const MachineInstr &MI, int &Index,73int64_t &Offset) const override;74};7576} // end namespace llvm7778#endif798081