Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- Thumb1InstrInfo.h - Thumb-1 Instruction Information -----*- C++ -*-===// |
David Goodwin | ade05a3 | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 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 | // This file contains the Thumb-1 implementation of the TargetInstrInfo class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 14 | #ifndef LLVM_LIB_TARGET_ARM_THUMB1INSTRINFO_H |
| 15 | #define LLVM_LIB_TARGET_ARM_THUMB1INSTRINFO_H |
David Goodwin | ade05a3 | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 16 | |
Craig Topper | 188ed9d | 2012-03-17 07:33:42 +0000 | [diff] [blame] | 17 | #include "ARMBaseInstrInfo.h" |
Eric Christopher | ae32649 | 2015-03-12 22:48:50 +0000 | [diff] [blame] | 18 | #include "ThumbRegisterInfo.h" |
David Goodwin | ade05a3 | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 19 | |
| 20 | namespace llvm { |
| 21 | class ARMSubtarget; |
| 22 | |
| 23 | class Thumb1InstrInfo : public ARMBaseInstrInfo { |
Eric Christopher | ae32649 | 2015-03-12 22:48:50 +0000 | [diff] [blame] | 24 | ThumbRegisterInfo RI; |
David Goodwin | ade05a3 | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 25 | public: |
| 26 | explicit Thumb1InstrInfo(const ARMSubtarget &STI); |
| 27 | |
Hans Wennborg | 9b9a535 | 2017-04-21 21:48:41 +0000 | [diff] [blame] | 28 | /// Return the noop instruction to use for a noop. |
| 29 | void getNoop(MCInst &NopInst) const override; |
Jim Grosbach | 617f84dd | 2012-02-28 23:53:30 +0000 | [diff] [blame] | 30 | |
David Goodwin | af7451b | 2009-07-08 16:09:28 +0000 | [diff] [blame] | 31 | // Return the non-pre/post incrementing version of 'Opc'. Return 0 |
| 32 | // if there is not such an opcode. |
Craig Topper | 6bc27bf | 2014-03-10 02:09:33 +0000 | [diff] [blame] | 33 | unsigned getUnindexedOpcode(unsigned Opc) const override; |
David Goodwin | af7451b | 2009-07-08 16:09:28 +0000 | [diff] [blame] | 34 | |
David Goodwin | ade05a3 | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 35 | /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As |
| 36 | /// such, whenever a client has an instance of instruction info, it should |
| 37 | /// always be able to get register info as well (through this method). |
| 38 | /// |
Eric Christopher | ae32649 | 2015-03-12 22:48:50 +0000 | [diff] [blame] | 39 | const ThumbRegisterInfo &getRegisterInfo() const override { return RI; } |
David Goodwin | ade05a3 | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 40 | |
Benjamin Kramer | bdc4956 | 2016-06-12 15:39:02 +0000 | [diff] [blame] | 41 | void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, |
| 42 | const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, |
Craig Topper | 6bc27bf | 2014-03-10 02:09:33 +0000 | [diff] [blame] | 43 | bool KillSrc) const override; |
David Goodwin | ade05a3 | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 44 | void storeRegToStackSlot(MachineBasicBlock &MBB, |
Eric Christopher | d246668 | 2010-10-15 22:49:28 +0000 | [diff] [blame] | 45 | MachineBasicBlock::iterator MBBI, |
| 46 | unsigned SrcReg, bool isKill, int FrameIndex, |
Evan Cheng | efb126a | 2010-05-06 19:06:44 +0000 | [diff] [blame] | 47 | const TargetRegisterClass *RC, |
Craig Topper | 6bc27bf | 2014-03-10 02:09:33 +0000 | [diff] [blame] | 48 | const TargetRegisterInfo *TRI) const override; |
David Goodwin | ade05a3 | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 49 | |
David Goodwin | ade05a3 | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 50 | void loadRegFromStackSlot(MachineBasicBlock &MBB, |
Eric Christopher | d246668 | 2010-10-15 22:49:28 +0000 | [diff] [blame] | 51 | MachineBasicBlock::iterator MBBI, |
| 52 | unsigned DestReg, int FrameIndex, |
Evan Cheng | efb126a | 2010-05-06 19:06:44 +0000 | [diff] [blame] | 53 | const TargetRegisterClass *RC, |
Craig Topper | 6bc27bf | 2014-03-10 02:09:33 +0000 | [diff] [blame] | 54 | const TargetRegisterInfo *TRI) const override; |
David Goodwin | ade05a3 | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 55 | |
Roger Ferrer Ibanez | aea4208 | 2018-01-31 09:23:43 +0000 | [diff] [blame] | 56 | bool canCopyGluedNodeDuringSchedule(SDNode *N) const override; |
Akira Hatanaka | e5b6e0d | 2014-07-25 19:31:34 +0000 | [diff] [blame] | 57 | private: |
Rafael Espindola | 82f4631 | 2016-06-28 15:18:26 +0000 | [diff] [blame] | 58 | void expandLoadStackGuard(MachineBasicBlock::iterator MI) const override; |
David Goodwin | ade05a3 | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 59 | }; |
Alexander Kornienko | f00654e | 2015-06-23 09:49:53 +0000 | [diff] [blame] | 60 | } |
David Goodwin | ade05a3 | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 61 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 62 | #endif |