aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/Xtensa/XtensaInstrInfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/Xtensa/XtensaInstrInfo.h')
-rw-r--r--llvm/lib/Target/Xtensa/XtensaInstrInfo.h72
1 files changed, 60 insertions, 12 deletions
diff --git a/llvm/lib/Target/Xtensa/XtensaInstrInfo.h b/llvm/lib/Target/Xtensa/XtensaInstrInfo.h
index 37f157f83246..5d1206b91808 100644
--- a/llvm/lib/Target/Xtensa/XtensaInstrInfo.h
+++ b/llvm/lib/Target/Xtensa/XtensaInstrInfo.h
@@ -38,6 +38,8 @@ public:
void adjustStackPtr(unsigned SP, int64_t Amount, MachineBasicBlock &MBB,
MachineBasicBlock::iterator I) const;
+ unsigned getInstSizeInBytes(const MachineInstr &MI) const override;
+
// Return the XtensaRegisterInfo, which this class owns.
const XtensaRegisterInfo &getRegisterInfo() const { return RI; }
@@ -49,20 +51,20 @@ public:
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
- bool KillSrc) const override;
+ bool KillSrc, bool RenamableDest = false,
+ bool RenamableSrc = false) const override;
- void storeRegToStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI, Register SrcReg,
- bool isKill, int FrameIndex,
- const TargetRegisterClass *RC,
- const TargetRegisterInfo *TRI,
- Register VReg) const override;
+ void storeRegToStackSlot(
+ MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register SrcReg,
+ bool isKill, int FrameIndex, const TargetRegisterClass *RC,
+ const TargetRegisterInfo *TRI, Register VReg,
+ MachineInstr::MIFlag Flags = MachineInstr::NoFlags) const override;
- void loadRegFromStackSlot(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MBBI, Register DestReg,
- int FrameIdx, const TargetRegisterClass *RC,
- const TargetRegisterInfo *TRI,
- Register VReg) const override;
+ void loadRegFromStackSlot(
+ MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
+ Register DestReg, int FrameIdx, const TargetRegisterClass *RC,
+ const TargetRegisterInfo *TRI, Register VReg,
+ MachineInstr::MIFlag Flags = MachineInstr::NoFlags) const override;
// Get the load and store opcodes for a given register class and offset.
void getLoadStoreOpcodes(const TargetRegisterClass *RC, unsigned &LoadOpcode,
@@ -73,6 +75,52 @@ public:
void loadImmediate(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
unsigned *Reg, int64_t Value) const;
+ bool
+ reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
+
+ MachineBasicBlock *getBranchDestBlock(const MachineInstr &MI) const override;
+
+ bool isBranchOffsetInRange(unsigned BranchOpc,
+ int64_t BrOffset) const override;
+
+ bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
+ MachineBasicBlock *&FBB,
+ SmallVectorImpl<MachineOperand> &Cond,
+ bool AllowModify) const override;
+
+ unsigned removeBranch(MachineBasicBlock &MBB,
+ int *BytesRemoved = nullptr) const override;
+
+ unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+ MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
+ const DebugLoc &DL,
+ int *BytesAdded = nullptr) const override;
+
+ void insertIndirectBranch(MachineBasicBlock &MBB, MachineBasicBlock &DestBB,
+ MachineBasicBlock &RestoreBB, const DebugLoc &DL,
+ int64_t BrOffset = 0,
+ RegScavenger *RS = nullptr) const override;
+
+ unsigned insertBranchAtInst(MachineBasicBlock &MBB,
+ MachineBasicBlock::iterator I,
+ MachineBasicBlock *TBB,
+ ArrayRef<MachineOperand> Cond, const DebugLoc &DL,
+ int *BytesAdded) const;
+
+ unsigned insertConstBranchAtInst(MachineBasicBlock &MBB, MachineInstr *I,
+ int64_t offset,
+ ArrayRef<MachineOperand> Cond, DebugLoc DL,
+ int *BytesAdded) const;
+
+ // Return true if MI is a conditional or unconditional branch.
+ // When returning true, set Cond to the mask of condition-code
+ // values on which the instruction will branch, and set Target
+ // to the operand that contains the branch target. This target
+ // can be a register or a basic block.
+ bool isBranch(const MachineBasicBlock::iterator &MI,
+ SmallVectorImpl<MachineOperand> &Cond,
+ const MachineOperand *&Target) const;
+
const XtensaSubtarget &getSubtarget() const { return STI; }
};
} // end namespace llvm