Misha Brukman | bc9ccf6 | 2005-02-04 20:25:52 +0000 | [diff] [blame] | 1 | //===- AlphaInstrInfo.h - Alpha Instruction Information ---------*- C++ -*-===// |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 2 | // |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 4ee451d | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 7 | // |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains the Alpha implementation of the TargetInstrInfo class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef ALPHAINSTRUCTIONINFO_H |
| 15 | #define ALPHAINSTRUCTIONINFO_H |
| 16 | |
| 17 | #include "llvm/Target/TargetInstrInfo.h" |
| 18 | #include "AlphaRegisterInfo.h" |
| 19 | |
Evan Cheng | 4db3cff | 2011-07-01 17:57:27 +0000 | [diff] [blame] | 20 | #define GET_INSTRINFO_HEADER |
| 21 | #include "AlphaGenInstrInfo.inc" |
| 22 | |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 23 | namespace llvm { |
| 24 | |
Evan Cheng | 4db3cff | 2011-07-01 17:57:27 +0000 | [diff] [blame] | 25 | class AlphaInstrInfo : public AlphaGenInstrInfo { |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 26 | const AlphaRegisterInfo RI; |
| 27 | public: |
| 28 | AlphaInstrInfo(); |
| 29 | |
| 30 | /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As |
| 31 | /// such, whenever a client has an instance of instruction info, it should |
| 32 | /// always be able to get register info as well (through this method). |
| 33 | /// |
Dan Gohman | c9f5f3f | 2008-05-14 01:58:56 +0000 | [diff] [blame] | 34 | virtual const AlphaRegisterInfo &getRegisterInfo() const { return RI; } |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 35 | |
Dan Gohman | cbad42c | 2008-11-18 19:49:32 +0000 | [diff] [blame] | 36 | virtual unsigned isLoadFromStackSlot(const MachineInstr *MI, |
| 37 | int &FrameIndex) const; |
| 38 | virtual unsigned isStoreToStackSlot(const MachineInstr *MI, |
| 39 | int &FrameIndex) const; |
Chris Lattner | 0476b28 | 2006-10-24 16:41:36 +0000 | [diff] [blame] | 40 | |
Evan Cheng | b5cdaa2 | 2007-05-18 00:05:48 +0000 | [diff] [blame] | 41 | virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, |
Stuart Hastings | 3bf9125 | 2010-06-17 22:43:56 +0000 | [diff] [blame] | 42 | MachineBasicBlock *FBB, |
| 43 | const SmallVectorImpl<MachineOperand> &Cond, |
| 44 | DebugLoc DL) const; |
Jakob Stoklund Olesen | 99666a3 | 2010-07-11 01:08:23 +0000 | [diff] [blame] | 45 | virtual void copyPhysReg(MachineBasicBlock &MBB, |
| 46 | MachineBasicBlock::iterator MI, DebugLoc DL, |
| 47 | unsigned DestReg, unsigned SrcReg, |
| 48 | bool KillSrc) const; |
Owen Anderson | f6372aa | 2008-01-01 21:11:32 +0000 | [diff] [blame] | 49 | virtual void storeRegToStackSlot(MachineBasicBlock &MBB, |
| 50 | MachineBasicBlock::iterator MBBI, |
| 51 | unsigned SrcReg, bool isKill, int FrameIndex, |
Evan Cheng | 746ad69 | 2010-05-06 19:06:44 +0000 | [diff] [blame] | 52 | const TargetRegisterClass *RC, |
| 53 | const TargetRegisterInfo *TRI) const; |
Owen Anderson | f6372aa | 2008-01-01 21:11:32 +0000 | [diff] [blame] | 54 | |
Owen Anderson | f6372aa | 2008-01-01 21:11:32 +0000 | [diff] [blame] | 55 | virtual void loadRegFromStackSlot(MachineBasicBlock &MBB, |
| 56 | MachineBasicBlock::iterator MBBI, |
| 57 | unsigned DestReg, int FrameIndex, |
Evan Cheng | 746ad69 | 2010-05-06 19:06:44 +0000 | [diff] [blame] | 58 | const TargetRegisterClass *RC, |
| 59 | const TargetRegisterInfo *TRI) const; |
Owen Anderson | 43dbe05 | 2008-01-07 01:35:02 +0000 | [diff] [blame] | 60 | |
Andrew Lenharth | f81173f | 2006-10-31 16:49:55 +0000 | [diff] [blame] | 61 | bool AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB, |
| 62 | MachineBasicBlock *&FBB, |
Evan Cheng | dc54d31 | 2009-02-09 07:14:22 +0000 | [diff] [blame] | 63 | SmallVectorImpl<MachineOperand> &Cond, |
| 64 | bool AllowModify) const; |
Evan Cheng | b5cdaa2 | 2007-05-18 00:05:48 +0000 | [diff] [blame] | 65 | unsigned RemoveBranch(MachineBasicBlock &MBB) const; |
Andrew Lenharth | f81173f | 2006-10-31 16:49:55 +0000 | [diff] [blame] | 66 | void insertNoop(MachineBasicBlock &MBB, |
| 67 | MachineBasicBlock::iterator MI) const; |
Owen Anderson | 44eb65c | 2008-08-14 22:49:33 +0000 | [diff] [blame] | 68 | bool ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const; |
Dan Gohman | 9911405 | 2009-06-03 20:30:14 +0000 | [diff] [blame] | 69 | |
| 70 | /// getGlobalBaseReg - Return a virtual register initialized with the |
| 71 | /// the global base register value. Output instructions required to |
| 72 | /// initialize the register in the function entry block, if necessary. |
| 73 | /// |
| 74 | unsigned getGlobalBaseReg(MachineFunction *MF) const; |
| 75 | |
| 76 | /// getGlobalRetAddr - Return a virtual register initialized with the |
| 77 | /// the global return address register value. Output instructions required to |
| 78 | /// initialize the register in the function entry block, if necessary. |
| 79 | /// |
| 80 | unsigned getGlobalRetAddr(MachineFunction *MF) const; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 81 | }; |
| 82 | |
| 83 | } |
| 84 | |
| 85 | #endif |