Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 1 | //===- AMDGPUMCInstLower.h MachineInstr Lowering Interface ------*- 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 | // |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
| 9 | |
Matt Arsenault | 6b6a2c3 | 2016-03-11 08:00:27 +0000 | [diff] [blame] | 10 | #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUMCINSTLOWER_H |
| 11 | #define LLVM_LIB_TARGET_AMDGPU_AMDGPUMCINSTLOWER_H |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 12 | |
| 13 | namespace llvm { |
| 14 | |
Tom Stellard | c721a23 | 2014-05-16 20:56:47 +0000 | [diff] [blame] | 15 | class AMDGPUSubtarget; |
Tom Stellard | 1b9748c | 2016-09-26 17:29:25 +0000 | [diff] [blame] | 16 | class AsmPrinter; |
Matt Arsenault | 6bc43d8 | 2016-10-06 16:20:41 +0000 | [diff] [blame] | 17 | class MachineBasicBlock; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 18 | class MachineInstr; |
Matt Arsenault | 6bc43d8 | 2016-10-06 16:20:41 +0000 | [diff] [blame] | 19 | class MachineOperand; |
Matt Arsenault | 236d9af | 2014-06-23 18:00:20 +0000 | [diff] [blame] | 20 | class MCContext; |
Matt Arsenault | 6bc43d8 | 2016-10-06 16:20:41 +0000 | [diff] [blame] | 21 | class MCExpr; |
Matt Arsenault | 236d9af | 2014-06-23 18:00:20 +0000 | [diff] [blame] | 22 | class MCInst; |
Matt Arsenault | 11f7402 | 2016-10-06 17:19:11 +0000 | [diff] [blame] | 23 | class MCOperand; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 24 | |
| 25 | class AMDGPUMCInstLower { |
Tom Stellard | 9e90b58 | 2012-12-17 15:14:54 +0000 | [diff] [blame] | 26 | MCContext &Ctx; |
Tom Stellard | c721a23 | 2014-05-16 20:56:47 +0000 | [diff] [blame] | 27 | const AMDGPUSubtarget &ST; |
Tom Stellard | 1b9748c | 2016-09-26 17:29:25 +0000 | [diff] [blame] | 28 | const AsmPrinter ≈ |
Tom Stellard | c721a23 | 2014-05-16 20:56:47 +0000 | [diff] [blame] | 29 | |
Matt Arsenault | 6bc43d8 | 2016-10-06 16:20:41 +0000 | [diff] [blame] | 30 | const MCExpr *getLongBranchBlockExpr(const MachineBasicBlock &SrcBB, |
| 31 | const MachineOperand &MO) const; |
| 32 | |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 33 | public: |
Tom Stellard | 1b9748c | 2016-09-26 17:29:25 +0000 | [diff] [blame] | 34 | AMDGPUMCInstLower(MCContext &ctx, const AMDGPUSubtarget &ST, |
| 35 | const AsmPrinter &AP); |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 36 | |
Matt Arsenault | 11f7402 | 2016-10-06 17:19:11 +0000 | [diff] [blame] | 37 | bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp) const; |
| 38 | |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 39 | /// \brief Lower a MachineInstr to an MCInst |
| 40 | void lower(const MachineInstr *MI, MCInst &OutMI) const; |
| 41 | |
| 42 | }; |
| 43 | |
| 44 | } // End namespace llvm |
| 45 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 46 | #endif |