LLVM  3.7.0
Public Member Functions | Public Attributes | List of all members
false::Chain Class Reference

A Chain is a sequence of instructions that are linked together by an accumulation operand. More...

Collaboration diagram for false::Chain:
[legend]

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. More...
 
bool contains (MachineInstr *MI)
 Return true if MI is a member of the chain. More...
 
unsigned size () const
 Return the number of instructions in the chain. More...
 
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. More...
 
MachineInstrgetStart () const
 Return the first instruction in the chain. More...
 
MachineInstrgetLast () const
 Return the last instruction in the chain. More...
 
MachineInstrgetKill () const
 Return the "kill" instruction (as set with setKill()) or NULL. More...
 
MachineBasicBlock::iterator getEnd () const
 Return an instruction that can be used as an iterator for the end of the chain. More...
 
bool isKillImmutable () const
 Can the Kill instruction (assuming one exists) be modified? More...
 
Color getPreferredColor ()
 Return the preferred color of this chain. More...
 
bool rangeOverlapsWith (const Chain &Other) const
 Return true if this chain (StartInst..KillInst) overlaps with Other. More...
 
bool startsBefore (const Chain *Other) const
 Return true if this chain starts before Other. More...
 
bool requiresFixup () const
 Return true if the group will require a fixup MOV at the end. More...
 
std::string str () const
 Return a simple string representation of the chain. More...
 

Public Attributes

MachineInstrStartInst
 The important (marker) instructions. More...
 
MachineInstrLastInst
 
MachineInstrKillInst
 
unsigned StartInstIdx
 The index, from the start of the basic block, that each marker appears. More...
 
unsigned LastInstIdx
 
unsigned KillInstIdx
 
std::set< MachineInstr * > Insts
 All instructions in the chain. More...
 
bool KillIsImmutable
 True if KillInst cannot be modified. More...
 
Color LastColor
 The "color" of LastInst. More...
 

Detailed Description

A Chain is a sequence of instructions that are linked together by an accumulation operand.

For example:

fmul d0<def>, ? fmla d1<def>, ?, ?, d0<kill> fmla d2<def>, ?, ?, d1<kill>

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 186 of file AArch64A57FPLoadBalancing.cpp.

Constructor & Destructor Documentation

false::Chain::Chain ( MachineInstr MI,
unsigned  Idx,
Color  C 
)
inline

Definition at line 204 of file AArch64A57FPLoadBalancing.cpp.

Member Function Documentation

void false::Chain::add ( MachineInstr MI,
unsigned  Idx,
Color  C 
)
inline

Add a new instruction into the chain.

The instruction's dest operand has the given color.

Definition at line 213 of file AArch64A57FPLoadBalancing.cpp.

References llvm::C, and llvm::AArch64CC::MI.

bool false::Chain::contains ( MachineInstr MI)
inline

Return true if MI is a member of the chain.

Definition at line 225 of file AArch64A57FPLoadBalancing.cpp.

MachineBasicBlock::iterator false::Chain::getEnd ( ) const
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 251 of file AArch64A57FPLoadBalancing.cpp.

MachineInstr* false::Chain::getKill ( ) const
inline

Return the "kill" instruction (as set with setKill()) or NULL.

Definition at line 248 of file AArch64A57FPLoadBalancing.cpp.

MachineInstr* false::Chain::getLast ( ) const
inline

Return the last instruction in the chain.

Definition at line 246 of file AArch64A57FPLoadBalancing.cpp.

Color false::Chain::getPreferredColor ( )
inline

Return the preferred color of this chain.

Definition at line 259 of file AArch64A57FPLoadBalancing.cpp.

References OverrideBalance.

MachineInstr* false::Chain::getStart ( ) const
inline

Return the first instruction in the chain.

Definition at line 244 of file AArch64A57FPLoadBalancing.cpp.

bool false::Chain::isKillImmutable ( ) const
inline

Can the Kill instruction (assuming one exists) be modified?

Definition at line 256 of file AArch64A57FPLoadBalancing.cpp.

bool false::Chain::rangeOverlapsWith ( const Chain Other) const
inline

Return true if this chain (StartInst..KillInst) overlaps with Other.

Definition at line 266 of file AArch64A57FPLoadBalancing.cpp.

References KillInst, KillInstIdx, LastInstIdx, and StartInstIdx.

bool false::Chain::requiresFixup ( ) const
inline

Return true if the group will require a fixup MOV at the end.

Definition at line 280 of file AArch64A57FPLoadBalancing.cpp.

void false::Chain::setKill ( MachineInstr MI,
unsigned  Idx,
bool  Immutable 
)
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 234 of file AArch64A57FPLoadBalancing.cpp.

References llvm::AArch64CC::MI.

unsigned false::Chain::size ( ) const
inline

Return the number of instructions in the chain.

Definition at line 228 of file AArch64A57FPLoadBalancing.cpp.

bool false::Chain::startsBefore ( const Chain Other) const
inline

Return true if this chain starts before Other.

Definition at line 275 of file AArch64A57FPLoadBalancing.cpp.

References StartInstIdx.

std::string false::Chain::str ( ) const
inline

Return a simple string representation of the chain.

Definition at line 285 of file AArch64A57FPLoadBalancing.cpp.

References llvm::raw_string_ostream::str().

Member Data Documentation

std::set<MachineInstr*> false::Chain::Insts

All instructions in the chain.

Definition at line 194 of file AArch64A57FPLoadBalancing.cpp.

MachineInstr * false::Chain::KillInst

Definition at line 189 of file AArch64A57FPLoadBalancing.cpp.

Referenced by rangeOverlapsWith().

unsigned false::Chain::KillInstIdx

Definition at line 192 of file AArch64A57FPLoadBalancing.cpp.

Referenced by rangeOverlapsWith().

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 198 of file AArch64A57FPLoadBalancing.cpp.

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 202 of file AArch64A57FPLoadBalancing.cpp.

MachineInstr * false::Chain::LastInst

Definition at line 189 of file AArch64A57FPLoadBalancing.cpp.

unsigned false::Chain::LastInstIdx

Definition at line 192 of file AArch64A57FPLoadBalancing.cpp.

Referenced by rangeOverlapsWith().

MachineInstr* false::Chain::StartInst

The important (marker) instructions.

Definition at line 189 of file AArch64A57FPLoadBalancing.cpp.

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 192 of file AArch64A57FPLoadBalancing.cpp.

Referenced by rangeOverlapsWith(), and startsBefore().


The documentation for this class was generated from the following file: