2012-02-18 20:03:15 +08:00
|
|
|
//===-- MSP430InstrInfo.h - MSP430 Instruction Information ------*- C++ -*-===//
|
2009-05-03 20:57:15 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08: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 20:57:15 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the MSP430 implementation of the TargetInstrInfo class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_MSP430_MSP430INSTRINFO_H
|
|
|
|
#define LLVM_LIB_TARGET_MSP430_MSP430INSTRINFO_H
|
2009-05-03 20:57:15 +08:00
|
|
|
|
|
|
|
#include "MSP430RegisterInfo.h"
|
2017-11-08 09:01:31 +08:00
|
|
|
#include "llvm/CodeGen/TargetInstrInfo.h"
|
2009-05-03 20:57:15 +08:00
|
|
|
|
2011-07-02 01:57:27 +08:00
|
|
|
#define GET_INSTRINFO_HEADER
|
|
|
|
#include "MSP430GenInstrInfo.inc"
|
|
|
|
|
2009-05-03 20:57:15 +08:00
|
|
|
namespace llvm {
|
|
|
|
|
2014-06-27 09:14:50 +08:00
|
|
|
class MSP430Subtarget;
|
2009-05-03 20:57:15 +08:00
|
|
|
|
2011-07-02 01:57:27 +08:00
|
|
|
class MSP430InstrInfo : public MSP430GenInstrInfo {
|
2009-05-03 20:57:15 +08:00
|
|
|
const MSP430RegisterInfo RI;
|
2013-11-19 08:57:56 +08:00
|
|
|
virtual void anchor();
|
2009-05-03 20:57:15 +08:00
|
|
|
public:
|
2014-06-27 09:14:50 +08:00
|
|
|
explicit MSP430InstrInfo(MSP430Subtarget &STI);
|
2009-05-03 20:57:15 +08: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 15:58:09 +08:00
|
|
|
const TargetRegisterInfo &getRegisterInfo() const { return RI; }
|
2009-05-03 21:02:04 +08:00
|
|
|
|
2016-06-12 23:39:02 +08:00
|
|
|
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
2019-11-11 16:24:21 +08:00
|
|
|
const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
|
2014-04-29 15:58:09 +08: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 21:22:06 +08:00
|
|
|
Register SrcReg, bool isKill,
|
2014-04-29 15:58:09 +08: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 21:22:06 +08:00
|
|
|
Register DestReg, int FrameIdx,
|
2014-04-29 15:58:09 +08:00
|
|
|
const TargetRegisterClass *RC,
|
|
|
|
const TargetRegisterInfo *TRI) const override;
|
2009-05-03 21:11:04 +08:00
|
|
|
|
2016-07-29 16:16:16 +08:00
|
|
|
unsigned getInstSizeInBytes(const MachineInstr &MI) const override;
|
2010-01-16 05:19:05 +08:00
|
|
|
|
2009-10-22 03:17:18 +08:00
|
|
|
// Branch folding goodness
|
2014-04-29 15:58:09 +08:00
|
|
|
bool
|
2016-09-15 04:43:16 +08:00
|
|
|
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
|
2016-07-15 22:41:04 +08:00
|
|
|
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
|
|
|
|
MachineBasicBlock *&FBB,
|
2009-10-22 03:17:18 +08:00
|
|
|
SmallVectorImpl<MachineOperand> &Cond,
|
2014-04-29 15:58:09 +08:00
|
|
|
bool AllowModify) const override;
|
2009-10-22 03:17:18 +08:00
|
|
|
|
2016-09-15 04:43:16 +08:00
|
|
|
unsigned removeBranch(MachineBasicBlock &MBB,
|
2016-09-15 01:23:48 +08:00
|
|
|
int *BytesRemoved = nullptr) const override;
|
2016-09-15 01:24:15 +08:00
|
|
|
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
|
2015-06-12 03:30:37 +08:00
|
|
|
MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
|
2016-09-15 01:23:48 +08:00
|
|
|
const DebugLoc &DL,
|
|
|
|
int *BytesAdded = nullptr) const override;
|
2017-05-09 21:35:13 +08: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 20:57:15 +08:00
|
|
|
};
|
|
|
|
|
2015-06-23 17:49:53 +08:00
|
|
|
}
|
2009-05-03 20:57:15 +08:00
|
|
|
|
|
|
|
#endif
|