llvm.org GIT mirror llvm / 0b2cd89
Branch Analysis and InsertNoop inserted into header files git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41155 91177308-0d34-0410-b5e6-96231b3b80d8 Bruno Cardoso Lopes 13 years ago
1 changed file(s) with 36 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
1818 #include "MipsRegisterInfo.h"
1919
2020 namespace llvm {
21
22 namespace Mips {
23
24 // All CC branch operations on Mips I are turned
25 // into BEQ and BNE CC branches instructions.
26 enum CondCode {
27 COND_E,
28 COND_GZ,
29 COND_GEZ,
30 COND_LZ,
31 COND_LEZ,
32 COND_NE,
33 COND_INVALID
34 };
35
36 // Turn condition code into conditional branch opcode.
37 unsigned GetCondBranchFromCond(CondCode CC);
38
39 /// GetOppositeBranchCondition - Return the inverse of the specified cond,
40 /// e.g. turning COND_E to COND_NE.
41 CondCode GetOppositeBranchCondition(Mips::CondCode CC);
42
43 }
2144
2245 class MipsInstrInfo : public TargetInstrInfo
2346 {
5174 /// not, return 0. This predicate must return 0 if the instruction has
5275 /// any side effects other than storing to the stack slot.
5376 virtual unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
54
77
78 /// Branch Analysis
79 virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
80 MachineBasicBlock *&FBB,
81 std::vector &Cond) const;
82 virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const;
5583 virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
56 MachineBasicBlock *FBB,
84 MachineBasicBlock *FBB,
5785 const std::vector &Cond) const;
86 virtual bool BlockHasNoFallThrough(MachineBasicBlock &MBB) const;
87 virtual bool ReverseBranchCondition(std::vector &Cond) const;
88
89 /// Insert nop instruction when hazard condition is found
90 virtual void insertNoop(MachineBasicBlock &MBB,
91 MachineBasicBlock::iterator MI) const;
5892 };
5993
6094 }