Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 1 | //=- WebAssemblyInstrInfo.h - WebAssembly Instruction Information -*- C++ -*-=// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | /// |
| 10 | /// \file |
| 11 | /// \brief This file contains the WebAssembly implementation of the |
| 12 | /// TargetInstrInfo class. |
| 13 | /// |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYINSTRINFO_H |
| 17 | #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYINSTRINFO_H |
| 18 | |
| 19 | #include "WebAssemblyRegisterInfo.h" |
| 20 | #include "llvm/Target/TargetInstrInfo.h" |
| 21 | |
JF Bastien | b9073fb | 2015-07-22 21:28:15 +0000 | [diff] [blame] | 22 | #define GET_INSTRINFO_HEADER |
| 23 | #include "WebAssemblyGenInstrInfo.inc" |
| 24 | |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 25 | namespace llvm { |
| 26 | |
| 27 | class WebAssemblySubtarget; |
| 28 | |
JF Bastien | b9073fb | 2015-07-22 21:28:15 +0000 | [diff] [blame] | 29 | class WebAssemblyInstrInfo final : public WebAssemblyGenInstrInfo { |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 30 | const WebAssemblyRegisterInfo RI; |
| 31 | |
| 32 | public: |
| 33 | explicit WebAssemblyInstrInfo(const WebAssemblySubtarget &STI); |
| 34 | |
| 35 | const WebAssemblyRegisterInfo &getRegisterInfo() const { return RI; } |
Dan Gohman | 4f52e00 | 2015-09-09 00:52:47 +0000 | [diff] [blame] | 36 | |
Dan Gohman | b6fd39a | 2016-01-19 16:59:23 +0000 | [diff] [blame^] | 37 | bool isReallyTriviallyReMaterializable(const MachineInstr *MI, |
| 38 | AliasAnalysis *AA) const override; |
| 39 | |
Dan Gohman | 4f52e00 | 2015-09-09 00:52:47 +0000 | [diff] [blame] | 40 | void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, |
| 41 | DebugLoc DL, unsigned DestReg, unsigned SrcReg, |
| 42 | bool KillSrc) const override; |
Dan Gohman | 950a13c | 2015-09-16 16:51:30 +0000 | [diff] [blame] | 43 | |
| 44 | bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, |
| 45 | MachineBasicBlock *&FBB, |
| 46 | SmallVectorImpl<MachineOperand> &Cond, |
| 47 | bool AllowModify = false) const override; |
| 48 | unsigned RemoveBranch(MachineBasicBlock &MBB) const override; |
| 49 | unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, |
Dan Gohman | 7a6b982 | 2015-11-29 22:32:02 +0000 | [diff] [blame] | 50 | MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond, |
Dan Gohman | 950a13c | 2015-09-16 16:51:30 +0000 | [diff] [blame] | 51 | DebugLoc DL) const override; |
| 52 | bool |
| 53 | ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override; |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 54 | }; |
| 55 | |
| 56 | } // end namespace llvm |
| 57 | |
| 58 | #endif |