LLVM 22.0.0git
|
A Chain is a sequence of instructions that are linked together by an accumulation operand. More...
Public Member Functions | |
Chain (MachineInstr *MI, unsigned Idx, Color C) | |
void | add (MachineInstr *MI, unsigned Idx, Color C) |
Add a new instruction into the chain. | |
bool | contains (MachineInstr &MI) |
Return true if MI is a member of the chain. | |
unsigned | size () const |
Return the number of instructions in the chain. | |
void | setKill (MachineInstr *MI, unsigned Idx, bool Immutable) |
Inform the chain that its last active register (the dest register of LastInst) is killed by MI with no intervening uses or defs. | |
MachineInstr * | getStart () const |
Return the first instruction in the chain. | |
MachineInstr * | getLast () const |
Return the last instruction in the chain. | |
MachineInstr * | getKill () const |
Return the "kill" instruction (as set with setKill()) or NULL. | |
MachineBasicBlock::iterator | end () const |
Return an instruction that can be used as an iterator for the end of the chain. | |
MachineBasicBlock::iterator | begin () const |
bool | isKillImmutable () const |
Can the Kill instruction (assuming one exists) be modified? | |
Color | getPreferredColor () |
Return the preferred color of this chain. | |
bool | rangeOverlapsWith (const Chain &Other) const |
Return true if this chain (StartInst..KillInst) overlaps with Other. | |
bool | startsBefore (const Chain *Other) const |
Return true if this chain starts before Other. | |
bool | requiresFixup () const |
Return true if the group will require a fixup MOV at the end. | |
std::string | str () const |
Return a simple string representation of the chain. |
Public Attributes | |
MachineInstr * | StartInst |
The important (marker) instructions. | |
MachineInstr * | LastInst |
MachineInstr * | KillInst |
unsigned | StartInstIdx |
The index, from the start of the basic block, that each marker appears. | |
unsigned | LastInstIdx |
unsigned | KillInstIdx |
std::set< MachineInstr * > | Insts |
All instructions in the chain. | |
bool | KillIsImmutable |
True if KillInst cannot be modified. | |
Color | LastColor |
The "color" of LastInst. |
A Chain is a sequence of instructions that are linked together by an accumulation operand.
For example:
fmul def d0, ? fmla def d1, ?, ?, killed d0 fmla def d2, ?, ?, killed d1
There may be other instructions interleaved in the sequence that do not belong to the chain. These other instructions must not use the "chain" register at any point.
We currently only support chains where the "chain" operand is killed at each link in the chain for simplicity. A chain has three important instructions - Start, Last and Kill.
Without a kill instruction, we must assume the outgoing value escapes beyond our model and either must not change its register or must create a fixup FMOV to keep the old register value consistent.
Definition at line 181 of file AArch64A57FPLoadBalancing.cpp.
|
inline |
Definition at line 199 of file AArch64A57FPLoadBalancing.cpp.
References llvm::CallingConv::C, Insts, KillInst, KillInstIdx, LastColor, LastInst, LastInstIdx, MI, StartInst, and StartInstIdx.
Referenced by rangeOverlapsWith(), and startsBefore().
|
inline |
Add a new instruction into the chain.
The instruction's dest operand has the given color.
Definition at line 208 of file AArch64A57FPLoadBalancing.cpp.
References assert(), llvm::CallingConv::C, Insts, KillInstIdx, LastColor, LastInst, LastInstIdx, and MI.
|
inline |
Definition at line 249 of file AArch64A57FPLoadBalancing.cpp.
References getStart().
|
inline |
Return true if MI is a member of the chain.
Definition at line 220 of file AArch64A57FPLoadBalancing.cpp.
|
inline |
Return an instruction that can be used as an iterator for the end of the chain.
This is the maximum of KillInst (if set) and LastInst.
Definition at line 246 of file AArch64A57FPLoadBalancing.cpp.
|
inline |
Return the "kill" instruction (as set with setKill()) or NULL.
Definition at line 243 of file AArch64A57FPLoadBalancing.cpp.
References KillInst.
Referenced by requiresFixup().
|
inline |
Return the last instruction in the chain.
Definition at line 241 of file AArch64A57FPLoadBalancing.cpp.
References LastInst.
|
inline |
Return the preferred color of this chain.
Definition at line 255 of file AArch64A57FPLoadBalancing.cpp.
References LastColor, and OverrideBalance.
|
inline |
Return the first instruction in the chain.
Definition at line 239 of file AArch64A57FPLoadBalancing.cpp.
References StartInst.
Referenced by begin().
|
inline |
Can the Kill instruction (assuming one exists) be modified?
Definition at line 252 of file AArch64A57FPLoadBalancing.cpp.
References KillIsImmutable.
Referenced by requiresFixup().
Return true if this chain (StartInst..KillInst) overlaps with Other.
Definition at line 262 of file AArch64A57FPLoadBalancing.cpp.
References Chain(), KillInst, KillInstIdx, LastInstIdx, llvm::Other, and StartInstIdx.
|
inline |
Return true if the group will require a fixup MOV at the end.
Definition at line 276 of file AArch64A57FPLoadBalancing.cpp.
References getKill(), and isKillImmutable().
|
inline |
Inform the chain that its last active register (the dest register of LastInst) is killed by MI with no intervening uses or defs.
Definition at line 229 of file AArch64A57FPLoadBalancing.cpp.
References assert(), KillInst, KillInstIdx, KillIsImmutable, LastInstIdx, and MI.
|
inline |
Return the number of instructions in the chain.
Definition at line 223 of file AArch64A57FPLoadBalancing.cpp.
References Insts.
Return true if this chain starts before Other.
Definition at line 271 of file AArch64A57FPLoadBalancing.cpp.
References Chain(), llvm::Other, and StartInstIdx.
|
inline |
Return a simple string representation of the chain.
Definition at line 281 of file AArch64A57FPLoadBalancing.cpp.
References KillInst, LastInst, StartInst, and llvm::raw_string_ostream::str().
std::set<MachineInstr*> false::Chain::Insts |
All instructions in the chain.
Definition at line 189 of file AArch64A57FPLoadBalancing.cpp.
Referenced by add(), Chain(), contains(), and size().
MachineInstr * false::Chain::KillInst |
Definition at line 184 of file AArch64A57FPLoadBalancing.cpp.
Referenced by Chain(), end(), getKill(), rangeOverlapsWith(), setKill(), and str().
unsigned false::Chain::KillInstIdx |
Definition at line 187 of file AArch64A57FPLoadBalancing.cpp.
Referenced by add(), Chain(), rangeOverlapsWith(), and setKill().
bool false::Chain::KillIsImmutable |
True if KillInst cannot be modified.
If this is true, we cannot change LastInst's outgoing register. This will be true for tied values and regmasks.
Definition at line 193 of file AArch64A57FPLoadBalancing.cpp.
Referenced by isKillImmutable(), and setKill().
Color false::Chain::LastColor |
The "color" of LastInst.
This will be the preferred chain color, as changing intermediate nodes is easy but changing the last instruction can be more tricky.
Definition at line 197 of file AArch64A57FPLoadBalancing.cpp.
Referenced by add(), Chain(), and getPreferredColor().
MachineInstr * false::Chain::LastInst |
unsigned false::Chain::LastInstIdx |
Definition at line 187 of file AArch64A57FPLoadBalancing.cpp.
Referenced by add(), Chain(), rangeOverlapsWith(), and setKill().
MachineInstr* false::Chain::StartInst |
The important (marker) instructions.
Definition at line 184 of file AArch64A57FPLoadBalancing.cpp.
Referenced by Chain(), getStart(), and str().
unsigned false::Chain::StartInstIdx |
The index, from the start of the basic block, that each marker appears.
These are stored so we can do quick interval tests.
Definition at line 187 of file AArch64A57FPLoadBalancing.cpp.
Referenced by Chain(), rangeOverlapsWith(), and startsBefore().