LLVM 19.0.0git
Functions | Variables
TargetSchedule.cpp File Reference
#include "llvm/CodeGen/TargetSchedule.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCInstrItineraries.h"
#include "llvm/MC/MCSchedule.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <numeric>

Go to the source code of this file.

Functions

static unsigned capLatency (int Cycles)
 
static unsigned findDefIdx (const MachineInstr *MI, unsigned DefOperIdx)
 Find the def index of this operand.
 
static unsigned findUseIdx (const MachineInstr *MI, unsigned UseOperIdx)
 Find the use index of this operand.
 

Variables

static cl::opt< boolEnableSchedModel ("schedmodel", cl::Hidden, cl::init(true), cl::desc("Use TargetSchedModel for latency lookup"))
 
static cl::opt< boolEnableSchedItins ("scheditins", cl::Hidden, cl::init(true), cl::desc("Use InstrItineraryData for latency lookup"))
 
static cl::opt< boolForceEnableIntervals ("sched-model-force-enable-intervals", cl::Hidden, cl::init(false), cl::desc("Force the use of resource intervals in the schedule model"))
 

Function Documentation

◆ capLatency()

static unsigned capLatency ( int  Cycles)
static

◆ findDefIdx()

static unsigned findDefIdx ( const MachineInstr MI,
unsigned  DefOperIdx 
)
static

Find the def index of this operand.

This index maps to the machine model and is independent of use operands. Def operands may be reordered with uses or merged with uses without affecting the def index (e.g. before/after regalloc). However, an instruction's def operands must never be reordered with respect to each other.

Definition at line 145 of file TargetSchedule.cpp.

References llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), and MI.

Referenced by llvm::TargetSchedModel::computeOperandLatency().

◆ findUseIdx()

static unsigned findUseIdx ( const MachineInstr MI,
unsigned  UseOperIdx 
)
static

Find the use index of this operand.

This is independent of the instruction's def operands.

Note that uses are not determined by the operand's isUse property, which is simply the inverse of isDef. Here we consider any readsReg operand to be a "use". The machine model allows an operand to be both a Def and Use.

Definition at line 161 of file TargetSchedule.cpp.

References llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), MI, and llvm::MachineOperand::readsReg().

Referenced by llvm::TargetSchedModel::computeOperandLatency().

Variable Documentation

◆ EnableSchedItins

cl::opt< bool > EnableSchedItins("scheditins", cl::Hidden, cl::init(true), cl::desc("Use InstrItineraryData for latency lookup")) ( "scheditins"  ,
cl::Hidden  ,
cl::init(true ,
cl::desc("Use InstrItineraryData for latency lookup")   
)
static

◆ EnableSchedModel

cl::opt< bool > EnableSchedModel("schedmodel", cl::Hidden, cl::init(true), cl::desc("Use TargetSchedModel for latency lookup")) ( "schedmodel"  ,
cl::Hidden  ,
cl::init(true ,
cl::desc("Use TargetSchedModel for latency lookup")   
)
static

◆ ForceEnableIntervals

cl::opt< bool > ForceEnableIntervals("sched-model-force-enable-intervals", cl::Hidden, cl::init(false), cl::desc("Force the use of resource intervals in the schedule model")) ( "sched-model-force-enable-intervals"  ,
cl::Hidden  ,
cl::init(false)  ,
cl::desc("Force the use of resource intervals in the schedule model")   
)
static