2009-11-08 06:00:39 +08:00
|
|
|
//===- Thumb2InstrInfo.h - Thumb-2 Instruction Information ------*- C++ -*-===//
|
2009-06-27 05:28:53 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2009-07-03 06:18:33 +08:00
|
|
|
// This file contains the Thumb-2 implementation of the TargetInstrInfo class.
|
2009-06-27 05:28:53 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-07-03 06:18:33 +08:00
|
|
|
#ifndef THUMB2INSTRUCTIONINFO_H
|
|
|
|
#define THUMB2INSTRUCTIONINFO_H
|
2009-06-27 05:28:53 +08:00
|
|
|
|
|
|
|
#include "llvm/Target/TargetInstrInfo.h"
|
|
|
|
#include "ARM.h"
|
|
|
|
#include "ARMInstrInfo.h"
|
2009-07-03 06:18:33 +08:00
|
|
|
#include "Thumb2RegisterInfo.h"
|
2009-06-27 05:28:53 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
2010-06-19 07:09:54 +08:00
|
|
|
class ARMSubtarget;
|
|
|
|
class ScheduleHazardRecognizer;
|
2009-06-27 05:28:53 +08:00
|
|
|
|
2009-07-03 06:18:33 +08:00
|
|
|
class Thumb2InstrInfo : public ARMBaseInstrInfo {
|
|
|
|
Thumb2RegisterInfo RI;
|
2009-06-27 05:28:53 +08:00
|
|
|
public:
|
2009-07-03 06:18:33 +08:00
|
|
|
explicit Thumb2InstrInfo(const ARMSubtarget &STI);
|
2009-06-27 05:28:53 +08:00
|
|
|
|
2009-07-09 00:09:28 +08:00
|
|
|
// Return the non-pre/post incrementing version of 'Opc'. Return 0
|
|
|
|
// if there is not such an opcode.
|
|
|
|
unsigned getUnindexedOpcode(unsigned Opc) const;
|
|
|
|
|
2010-06-19 07:09:54 +08:00
|
|
|
void ReplaceTailWithBranchTo(MachineBasicBlock::iterator Tail,
|
|
|
|
MachineBasicBlock *NewDest) const;
|
|
|
|
|
2010-06-22 09:18:16 +08:00
|
|
|
bool isLegalToSplitMBBAt(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MBBI) const;
|
|
|
|
|
2010-06-26 06:42:03 +08:00
|
|
|
bool isProfitableToIfCvt(MachineBasicBlock &MBB, unsigned NumInstrs) const;
|
|
|
|
|
|
|
|
bool isProfitableToIfCvt(MachineBasicBlock &TMBB, unsigned NumTInstrs,
|
|
|
|
MachineBasicBlock &FMBB, unsigned NumFInstrs) const;
|
|
|
|
|
2010-07-11 14:33:54 +08:00
|
|
|
void copyPhysReg(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I, DebugLoc DL,
|
|
|
|
unsigned DestReg, unsigned SrcReg,
|
|
|
|
bool KillSrc) const;
|
2009-07-17 07:26:06 +08:00
|
|
|
|
2009-07-27 11:14:20 +08:00
|
|
|
void storeRegToStackSlot(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MBBI,
|
|
|
|
unsigned SrcReg, bool isKill, int FrameIndex,
|
2010-05-07 03:06:44 +08:00
|
|
|
const TargetRegisterClass *RC,
|
|
|
|
const TargetRegisterInfo *TRI) const;
|
2009-07-27 11:14:20 +08:00
|
|
|
|
|
|
|
void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator MBBI,
|
|
|
|
unsigned DestReg, int FrameIndex,
|
2010-05-07 03:06:44 +08:00
|
|
|
const TargetRegisterClass *RC,
|
|
|
|
const TargetRegisterInfo *TRI) const;
|
2009-07-27 11:14:20 +08:00
|
|
|
|
2010-06-10 03:26:01 +08:00
|
|
|
/// scheduleTwoAddrSource - Schedule the copy / re-mat of the source of the
|
|
|
|
/// two-addrss instruction inserted by two-address pass.
|
|
|
|
void scheduleTwoAddrSource(MachineInstr *SrcMI, MachineInstr *UseMI,
|
|
|
|
const TargetRegisterInfo &TRI) const;
|
|
|
|
|
2009-06-27 20:16:40 +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).
|
|
|
|
///
|
2009-07-03 06:18:33 +08:00
|
|
|
const Thumb2RegisterInfo &getRegisterInfo() const { return RI; }
|
2010-06-19 07:09:54 +08:00
|
|
|
|
|
|
|
ScheduleHazardRecognizer *
|
|
|
|
CreateTargetPostRAHazardRecognizer(const InstrItineraryData &II) const;
|
2009-06-27 05:28:53 +08:00
|
|
|
};
|
2010-06-22 09:18:16 +08:00
|
|
|
|
|
|
|
/// getITInstrPredicate - Valid only in Thumb2 mode. This function is identical
|
|
|
|
/// to llvm::getInstrPredicate except it returns AL for conditional branch
|
|
|
|
/// instructions which are "predicated", but are not in IT blocks.
|
|
|
|
ARMCC::CondCodes getITInstrPredicate(const MachineInstr *MI, unsigned &PredReg);
|
|
|
|
|
|
|
|
|
2009-06-27 05:28:53 +08:00
|
|
|
}
|
|
|
|
|
2009-07-03 06:18:33 +08:00
|
|
|
#endif // THUMB2INSTRUCTIONINFO_H
|