LLVM 20.0.0git
Public Member Functions | List of all members
llvm::TargetInstrInfo::PipelinerLoopInfo Class Referenceabstract

Object returned by analyzeLoopForPipelining. More...

#include "llvm/CodeGen/TargetInstrInfo.h"

Public Member Functions

virtual ~PipelinerLoopInfo ()
 
virtual bool shouldIgnoreForPipelining (const MachineInstr *MI) const =0
 Return true if the given instruction should not be pipelined and should be ignored.
 
virtual bool shouldUseSchedule (SwingSchedulerDAG &SSD, SMSchedule &SMS)
 Return true if the proposed schedule should used.
 
virtual std::optional< boolcreateTripCountGreaterCondition (int TC, MachineBasicBlock &MBB, SmallVectorImpl< MachineOperand > &Cond)=0
 Create a condition to determine if the trip count of the loop is greater than TC, where TC is always one more than for the previous prologue or 0 if this is being called for the outermost prologue.
 
virtual void createRemainingIterationsGreaterCondition (int TC, MachineBasicBlock &MBB, SmallVectorImpl< MachineOperand > &Cond, DenseMap< MachineInstr *, MachineInstr * > &LastStage0Insts)
 Create a condition to determine if the remaining trip count for a phase is greater than TC.
 
virtual void adjustTripCount (int TripCountAdjust)=0
 Modify the loop such that the trip count is OriginalTC + TripCountAdjust.
 
virtual void setPreheader (MachineBasicBlock *NewPreheader)=0
 Called when the loop's preheader has been modified to NewPreheader.
 
virtual void disposed ()=0
 Called when the loop is being removed.
 
virtual bool isMVEExpanderSupported ()
 Return true if the target can expand pipelined schedule with modulo variable expansion.
 

Detailed Description

Object returned by analyzeLoopForPipelining.

Allows software pipelining implementations to query attributes of the loop being pipelined and to apply target-specific updates to the loop once pipelining is complete.

Definition at line 747 of file TargetInstrInfo.h.

Constructor & Destructor Documentation

◆ ~PipelinerLoopInfo()

TargetInstrInfo::PipelinerLoopInfo::~PipelinerLoopInfo ( )
virtualdefault

Member Function Documentation

◆ adjustTripCount()

virtual void llvm::TargetInstrInfo::PipelinerLoopInfo::adjustTripCount ( int  TripCountAdjust)
pure virtual

Modify the loop such that the trip count is OriginalTC + TripCountAdjust.

◆ createRemainingIterationsGreaterCondition()

virtual void llvm::TargetInstrInfo::PipelinerLoopInfo::createRemainingIterationsGreaterCondition ( int  TC,
MachineBasicBlock MBB,
SmallVectorImpl< MachineOperand > &  Cond,
DenseMap< MachineInstr *, MachineInstr * > &  LastStage0Insts 
)
inlinevirtual

Create a condition to determine if the remaining trip count for a phase is greater than TC.

Some instructions such as comparisons may be inserted at the bottom of MBB. All instructions expanded for the phase must be inserted in MBB before calling this function. LastStage0Insts is the map from the original instructions scheduled at stage#0 to the expanded instructions for the last iteration of the kernel. LastStage0Insts is intended to obtain the instruction that refers the latest loop counter value.

MBB can also be a predecessor of the prologue block. Then LastStage0Insts must be empty and the compared value is the initial value of the trip count.

Definition at line 789 of file TargetInstrInfo.h.

References llvm_unreachable.

◆ createTripCountGreaterCondition()

virtual std::optional< bool > llvm::TargetInstrInfo::PipelinerLoopInfo::createTripCountGreaterCondition ( int  TC,
MachineBasicBlock MBB,
SmallVectorImpl< MachineOperand > &  Cond 
)
pure virtual

Create a condition to determine if the trip count of the loop is greater than TC, where TC is always one more than for the previous prologue or 0 if this is being called for the outermost prologue.

If the trip count is statically known to be greater than TC, return true. If the trip count is statically known to be not greater than TC, return false. Otherwise return nullopt and fill out Cond with the test condition.

Note: This hook is guaranteed to be called from the innermost to the outermost prologue of the loop being software pipelined.

◆ disposed()

virtual void llvm::TargetInstrInfo::PipelinerLoopInfo::disposed ( )
pure virtual

Called when the loop is being removed.

Any instructions in the preheader should be removed.

Once this function is called, no other functions on this object are valid; the loop has been removed.

◆ isMVEExpanderSupported()

virtual bool llvm::TargetInstrInfo::PipelinerLoopInfo::isMVEExpanderSupported ( )
inlinevirtual

Return true if the target can expand pipelined schedule with modulo variable expansion.

Definition at line 813 of file TargetInstrInfo.h.

Referenced by llvm::SwingSchedulerDAG::schedule().

◆ setPreheader()

virtual void llvm::TargetInstrInfo::PipelinerLoopInfo::setPreheader ( MachineBasicBlock NewPreheader)
pure virtual

Called when the loop's preheader has been modified to NewPreheader.

◆ shouldIgnoreForPipelining()

virtual bool llvm::TargetInstrInfo::PipelinerLoopInfo::shouldIgnoreForPipelining ( const MachineInstr MI) const
pure virtual

Return true if the given instruction should not be pipelined and should be ignored.

An example could be a loop comparison, or induction variable update with no users being pipelined.

Referenced by llvm::SMSchedule::computeUnpipelineableNodes().

◆ shouldUseSchedule()

virtual bool llvm::TargetInstrInfo::PipelinerLoopInfo::shouldUseSchedule ( SwingSchedulerDAG SSD,
SMSchedule SMS 
)
inlinevirtual

Return true if the proposed schedule should used.

Otherwise return false to not pipeline the loop. This function should be used to ensure that pipelined loops meet target-specific quality heuristics.

Definition at line 758 of file TargetInstrInfo.h.


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