|
LLVM
4.0.0
|
This pass is used to workaround certain pipeline hazards. More...
#include "Mips.h"#include "MipsInstrInfo.h"#include "MipsSEInstrInfo.h"#include "MipsTargetMachine.h"#include "llvm/ADT/Statistic.h"#include "llvm/CodeGen/MachineFunctionPass.h"#include "llvm/CodeGen/MachineInstrBuilder.h"#include "llvm/IR/Function.h"#include "llvm/Target/TargetInstrInfo.h"#include "llvm/Target/TargetMachine.h"#include "llvm/Target/TargetRegisterInfo.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "mips-hazard-schedule" |
Functions | |
| STATISTIC (NumInsertedNops,"Number of nops inserted") | |
| static Iter | getNextMachineInstrInBB (Iter Position) |
| static Iter | getNextMachineInstr (Iter Position, MachineBasicBlock *Parent) |
This pass is used to workaround certain pipeline hazards.
For now, this covers compact branch hazards. In future this pass can be extended to other pipeline hazards, such as various MIPS1 hazards, processor errata that require instruction reorganization, etc.
This pass has to run after the delay slot filler as that pass can introduce pipeline hazards, hence the existing hazard recognizer is not suitable.
Hazards handled: forbidden slots for MIPSR6.
A forbidden slot hazard occurs when a compact branch instruction is executed and the adjacent instruction in memory is a control transfer instruction such as a branch or jump, ERET, ERETNC, DERET, WAIT and PAUSE.
For example:
0x8004 bnec a1,v0,<P+0x18> 0x8008 beqc a1,a2,<P+0x54>
In such cases, the processor is required to signal a Reserved Instruction exception.
Here, if the instruction at 0x8004 is executed, the processor will raise an exception as there is a control transfer instruction at 0x8008.
There are two sources of forbidden slot hazards:
A) A previous pass has created a compact branch directly. B) Transforming a delay slot branch into compact branch. This case can be difficult to process as lookahead for hazards is insufficent, as backwards delay slot fillling can also produce hazards in previously processed instuctions.
Definition in file MipsHazardSchedule.cpp.
| #define DEBUG_TYPE "mips-hazard-schedule" |
Definition at line 59 of file MipsHazardSchedule.cpp.
|
static |
|
static |
Definition at line 96 of file MipsHazardSchedule.cpp.
References E, llvm::find_if_not(), and I.
Referenced by getNextMachineInstr().
| STATISTIC | ( | NumInsertedNops | , |
| "Number of nops inserted" | |||
| ) |
1.8.6