mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-14 15:19:33 +00:00
MI-Sched: handle ReadAdvance latencies as used by Swift.
llvm-svn: 184135
This commit is contained in:
parent
5a345856da
commit
797eafc983
@ -201,7 +201,10 @@ unsigned TargetSchedModel::computeOperandLatency(
|
||||
if (UseDesc->NumReadAdvanceEntries == 0)
|
||||
return Latency;
|
||||
unsigned UseIdx = findUseIdx(UseMI, UseOperIdx);
|
||||
return Latency - STI->getReadAdvanceCycles(UseDesc, UseIdx, WriteID);
|
||||
int Advance = STI->getReadAdvanceCycles(UseDesc, UseIdx, WriteID);
|
||||
if (Advance > 0 && (unsigned)Advance > Latency) // unsigned wrap
|
||||
return 0;
|
||||
return Latency - Advance;
|
||||
}
|
||||
// If DefIdx does not exist in the model (e.g. implicit defs), then return
|
||||
// unit latency (defaultDefLatency may be too conservative).
|
||||
|
Loading…
Reference in New Issue
Block a user