2012-02-18 13:03:15 +01:00
|
|
|
//===-- MSP430InstrInfo.h - MSP430 Instruction Information ------*- C++ -*-===//
|
2009-05-03 14:57:15 +02:00
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2009-05-03 14:57:15 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the MSP430 implementation of the TargetInstrInfo class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-13 18:26:38 +02:00
|
|
|
#ifndef LLVM_LIB_TARGET_MSP430_MSP430INSTRINFO_H
|
|
|
|
#define LLVM_LIB_TARGET_MSP430_MSP430INSTRINFO_H
|
2009-05-03 14:57:15 +02:00
|
|
|
|
|
|
|
#include "MSP430RegisterInfo.h"
|
2017-11-08 02:01:31 +01:00
|
|
|
#include "llvm/CodeGen/TargetInstrInfo.h"
|
2009-05-03 14:57:15 +02:00
|
|
|
|
2011-07-01 19:57:27 +02:00
|
|
|
#define GET_INSTRINFO_HEADER
|
|
|
|
#include "MSP430GenInstrInfo.inc"
|
|
|
|
|
2009-05-03 14:57:15 +02:00
|
|
|
namespace llvm {
|
|
|
|
|
2014-06-27 03:14:50 +02:00
|
|
|
class MSP430Subtarget;
|
2009-05-03 14:57:15 +02:00
|
|
|
|
2011-07-01 19:57:27 +02:00
|
|
|
class MSP430InstrInfo : public MSP430GenInstrInfo {
|
2009-05-03 14:57:15 +02:00
|
|
|
const MSP430RegisterInfo RI;
|
2013-11-19 01:57:56 +01:00
|
|
|
virtual void anchor();
|
2009-05-03 14:57:15 +02:00
|
|
|
public:
|
2014-06-27 03:14:50 +02:00
|
|
|
explicit MSP430InstrInfo(MSP430Subtarget &STI);
|
2009-05-03 14:57:15 +02:00
|
|
|
|
|
|
|
/// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
|
|
|
|
/// such, whenever a client has an instance of instruction info, it should
|
|
|
|
/// always be able to get register info as well (through this method).
|
|
|
|
///
|
2014-04-29 09:58:09 +02:00
|
|
|
const TargetRegisterInfo &getRegisterInfo() const { return RI; }
|
2009-05-03 15:02:04 +02:00
|
|
|
|
2016-06-12 17:39:02 +02:00
|
|
|
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
2019-11-11 09:24:21 +01:00
|
|
|
const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
|
2014-04-29 09:58:09 +02:00
|
|
|
bool KillSrc) const override;
|
|
|
|
|
|
|
|
void storeRegToStackSlot(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MI,
|
[NFC] unsigned->Register in storeRegTo/loadRegFromStack
Summary:
This patch makes progress on the 'unsigned -> Register' rewrite for
`TargetInstrInfo::loadRegFromStack` and `TII::storeRegToStack`.
Reviewers: arsenm, craig.topper, uweigand, jpienaar, atanasyan, venkatra, robertlytton, dylanmckay, t.p.northover, kparzysz, tstellar, k-ishizaka
Reviewed By: arsenm
Subscribers: wuzish, merge_guards_bot, jyknight, sdardis, nemanjai, jvesely, wdng, nhaehnle, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73870
2020-02-03 14:22:06 +01:00
|
|
|
Register SrcReg, bool isKill,
|
2014-04-29 09:58:09 +02:00
|
|
|
int FrameIndex,
|
|
|
|
const TargetRegisterClass *RC,
|
|
|
|
const TargetRegisterInfo *TRI) const override;
|
|
|
|
void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MI,
|
[NFC] unsigned->Register in storeRegTo/loadRegFromStack
Summary:
This patch makes progress on the 'unsigned -> Register' rewrite for
`TargetInstrInfo::loadRegFromStack` and `TII::storeRegToStack`.
Reviewers: arsenm, craig.topper, uweigand, jpienaar, atanasyan, venkatra, robertlytton, dylanmckay, t.p.northover, kparzysz, tstellar, k-ishizaka
Reviewed By: arsenm
Subscribers: wuzish, merge_guards_bot, jyknight, sdardis, nemanjai, jvesely, wdng, nhaehnle, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73870
2020-02-03 14:22:06 +01:00
|
|
|
Register DestReg, int FrameIdx,
|
2014-04-29 09:58:09 +02:00
|
|
|
const TargetRegisterClass *RC,
|
|
|
|
const TargetRegisterInfo *TRI) const override;
|
2009-05-03 15:11:04 +02:00
|
|
|
|
2016-07-29 10:16:16 +02:00
|
|
|
unsigned getInstSizeInBytes(const MachineInstr &MI) const override;
|
2010-01-15 22:19:05 +01:00
|
|
|
|
2009-10-21 21:17:18 +02:00
|
|
|
// Branch folding goodness
|
2014-04-29 09:58:09 +02:00
|
|
|
bool
|
2016-09-14 22:43:16 +02:00
|
|
|
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
|
2016-07-15 16:41:04 +02:00
|
|
|
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
|
|
|
|
MachineBasicBlock *&FBB,
|
2009-10-21 21:17:18 +02:00
|
|
|
SmallVectorImpl<MachineOperand> &Cond,
|
2014-04-29 09:58:09 +02:00
|
|
|
bool AllowModify) const override;
|
2009-10-21 21:17:18 +02:00
|
|
|
|
2016-09-14 22:43:16 +02:00
|
|
|
unsigned removeBranch(MachineBasicBlock &MBB,
|
2016-09-14 19:23:48 +02:00
|
|
|
int *BytesRemoved = nullptr) const override;
|
2016-09-14 19:24:15 +02:00
|
|
|
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
|
2015-06-11 21:30:37 +02:00
|
|
|
MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
|
2016-09-14 19:23:48 +02:00
|
|
|
const DebugLoc &DL,
|
|
|
|
int *BytesAdded = nullptr) const override;
|
2017-05-09 15:35:13 +02:00
|
|
|
|
|
|
|
int64_t getFramePoppedByCallee(const MachineInstr &I) const {
|
|
|
|
assert(isFrameInstr(I) && "Not a frame instruction");
|
|
|
|
assert(I.getOperand(1).getImm() >= 0 && "Size must not be negative");
|
|
|
|
return I.getOperand(1).getImm();
|
|
|
|
}
|
2009-05-03 14:57:15 +02:00
|
|
|
};
|
|
|
|
|
2015-06-23 11:49:53 +02:00
|
|
|
}
|
2009-05-03 14:57:15 +02:00
|
|
|
|
|
|
|
#endif
|