diff options
| author | Daniel Sanders <daniel.sanders@imgtec.com> | 2016-03-14 16:24:05 +0000 |
|---|---|---|
| committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2016-03-14 16:24:05 +0000 |
| commit | e8efff373a5118edf298b63a4c24cdbcc3ebd1da (patch) | |
| tree | f6b1d2a5e048d5e00395f880927d151257ec02e4 /llvm/lib/Target/Mips/MipsInstrInfo.h | |
| parent | aeb7b539f59cc9dd4e1a28c4cf841d19ba75e5a9 (diff) | |
| download | bcm5719-llvm-e8efff373a5118edf298b63a4c24cdbcc3ebd1da.tar.gz bcm5719-llvm-e8efff373a5118edf298b63a4c24cdbcc3ebd1da.zip | |
[mips] MIPS32R6 compact branch support
Summary:
MIPSR6 introduces a class of branches called compact branches. Unlike the
traditional MIPS branches which have a delay slot, compact branches do not
have a delay slot. The instruction following the compact branch is only
executed if the branch is not taken and must not be a branch.
It works by generating compact branches for MIPS32R6 when the delay slot
filler cannot fill a delay slot. Then, inspecting the generated code for
forbidden slot hazards (a compact branch with an adjacent branch or other
CTI) and inserting nops to clear this hazard.
Patch by Simon Dardis.
Reviewers: vkalintiris, dsanders
Subscribers: MatzeB, dsanders, llvm-commits
Differential Revision: http://reviews.llvm.org/D16353
llvm-svn: 263444
Diffstat (limited to 'llvm/lib/Target/Mips/MipsInstrInfo.h')
| -rw-r--r-- | llvm/lib/Target/Mips/MipsInstrInfo.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsInstrInfo.h b/llvm/lib/Target/Mips/MipsInstrInfo.h index cb1134ecc35..b6361a2c506 100644 --- a/llvm/lib/Target/Mips/MipsInstrInfo.h +++ b/llvm/lib/Target/Mips/MipsInstrInfo.h @@ -70,6 +70,15 @@ public: bool AllowModify, SmallVectorImpl<MachineInstr*> &BranchInstrs) const; + /// Determine the opcode of a non-delay slot form for a branch if one exists. + unsigned getEquivalentCompactForm(const MachineBasicBlock::iterator I) const; + + /// Predicate to determine if an instruction can go in a forbidden slot. + bool SafeInForbiddenSlot(const MachineInstr &MI) const; + + /// Predicate to determine if an instruction has a forbidden slot. + bool HasForbiddenSlot(const MachineInstr &MI) const; + /// Insert nop instruction when hazard condition is found void insertNoop(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override; |

