mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
Machine Model: Add MicroOpBufferSize and resource BufferSize.
Replace the ill-defined MinLatency and ILPWindow properties with with straightforward buffer sizes: MCSchedMode::MicroOpBufferSize MCProcResourceDesc::BufferSize These can be used to more precisely model instruction execution if desired. Disabled some misched tests temporarily. They'll be reenabled in a few commits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184032 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -668,27 +668,13 @@ getOperandLatency(const InstrItineraryData *ItinData,
|
||||
/// lookup, do so. Otherwise return -1.
|
||||
int TargetInstrInfo::computeDefOperandLatency(
|
||||
const InstrItineraryData *ItinData,
|
||||
const MachineInstr *DefMI, bool FindMin) const {
|
||||
const MachineInstr *DefMI) const {
|
||||
|
||||
// Let the target hook getInstrLatency handle missing itineraries.
|
||||
if (!ItinData)
|
||||
return getInstrLatency(ItinData, DefMI);
|
||||
|
||||
// Return a latency based on the itinerary properties and defining instruction
|
||||
// if possible. Some common subtargets don't require per-operand latency,
|
||||
// especially for minimum latencies.
|
||||
if (FindMin) {
|
||||
// If MinLatency is valid, call getInstrLatency. This uses Stage latency if
|
||||
// it exists before defaulting to MinLatency.
|
||||
if (ItinData->SchedModel->MinLatency >= 0)
|
||||
return getInstrLatency(ItinData, DefMI);
|
||||
|
||||
// If MinLatency is invalid, OperandLatency is interpreted as MinLatency.
|
||||
// For empty itineraries, short-cirtuit the check and default to one cycle.
|
||||
if (ItinData->isEmpty())
|
||||
return 1;
|
||||
}
|
||||
else if(ItinData->isEmpty())
|
||||
if(ItinData->isEmpty())
|
||||
return defaultDefLatency(ItinData->SchedModel, DefMI);
|
||||
|
||||
// ...operand lookup required
|
||||
@@ -709,10 +695,9 @@ int TargetInstrInfo::computeDefOperandLatency(
|
||||
unsigned TargetInstrInfo::
|
||||
computeOperandLatency(const InstrItineraryData *ItinData,
|
||||
const MachineInstr *DefMI, unsigned DefIdx,
|
||||
const MachineInstr *UseMI, unsigned UseIdx,
|
||||
bool FindMin) const {
|
||||
const MachineInstr *UseMI, unsigned UseIdx) const {
|
||||
|
||||
int DefLatency = computeDefOperandLatency(ItinData, DefMI, FindMin);
|
||||
int DefLatency = computeDefOperandLatency(ItinData, DefMI);
|
||||
if (DefLatency >= 0)
|
||||
return DefLatency;
|
||||
|
||||
@@ -732,8 +717,7 @@ computeOperandLatency(const InstrItineraryData *ItinData,
|
||||
unsigned InstrLatency = getInstrLatency(ItinData, DefMI);
|
||||
|
||||
// Expected latency is the max of the stage latency and itinerary props.
|
||||
if (!FindMin)
|
||||
InstrLatency = std::max(InstrLatency,
|
||||
defaultDefLatency(ItinData->SchedModel, DefMI));
|
||||
InstrLatency = std::max(InstrLatency,
|
||||
defaultDefLatency(ItinData->SchedModel, DefMI));
|
||||
return InstrLatency;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user