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