aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/Mips/MipsTargetMachine.cpp
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2016-03-14 16:24:05 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2016-03-14 16:24:05 +0000
commite8efff373a5118edf298b63a4c24cdbcc3ebd1da (patch)
treef6b1d2a5e048d5e00395f880927d151257ec02e4 /llvm/lib/Target/Mips/MipsTargetMachine.cpp
parentaeb7b539f59cc9dd4e1a28c4cf841d19ba75e5a9 (diff)
downloadllvm-e8efff373a5118edf298b63a4c24cdbcc3ebd1da.zip
llvm-e8efff373a5118edf298b63a4c24cdbcc3ebd1da.tar.gz
llvm-e8efff373a5118edf298b63a4c24cdbcc3ebd1da.tar.bz2
[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/MipsTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsTargetMachine.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/llvm/lib/Target/Mips/MipsTargetMachine.cpp
index 3e63872..607d124 100644
--- a/llvm/lib/Target/Mips/MipsTargetMachine.cpp
+++ b/llvm/lib/Target/Mips/MipsTargetMachine.cpp
@@ -250,7 +250,13 @@ TargetIRAnalysis MipsTargetMachine::getTargetIRAnalysis() {
// print out the code after the passes.
void MipsPassConfig::addPreEmitPass() {
MipsTargetMachine &TM = getMipsTargetMachine();
+
+ // The delay slot filler pass can potientially create forbidden slot (FS)
+ // hazards for MIPSR6 which the hazard schedule pass (HSP) will fix. Any
+ // (new) pass that creates compact branches after the HSP must handle FS
+ // hazards itself or be pipelined before the HSP.
addPass(createMipsDelaySlotFillerPass(TM));
+ addPass(createMipsHazardSchedule(TM));
addPass(createMipsLongBranchPass(TM));
addPass(createMipsConstantIslandPass(TM));
}