diff options
author | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2018-04-13 15:19:07 +0000 |
---|---|---|
committer | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2018-04-13 15:19:07 +0000 |
commit | c752616f30417e277c372ebb32770f62c54b058e (patch) | |
tree | 74dfbe33cefedb04eddf1b503bfdf49b5efe0860 /llvm/tools/llvm-mca/Scheduler.h | |
parent | 545a0c2fb0886f1c0140ef6cbd05ca0a1c8f800a (diff) | |
download | bcm5719-llvm-c752616f30417e277c372ebb32770f62c54b058e.tar.gz bcm5719-llvm-c752616f30417e277c372ebb32770f62c54b058e.zip |
[llvm-mca] Ensure that instructions with a schedule read-advance are always issued in the right order.
Normally, the Scheduler prioritizes older instructions over younger instructions
during the instruction issue stage. In one particular case where a dependent
instruction had a schedule read-advance associated to one of the input operands,
this rule was not correctly applied.
This patch fixes the issue and adds a test to verify that we don't regress that
particular case.
llvm-svn: 330032
Diffstat (limited to 'llvm/tools/llvm-mca/Scheduler.h')
-rw-r--r-- | llvm/tools/llvm-mca/Scheduler.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/tools/llvm-mca/Scheduler.h b/llvm/tools/llvm-mca/Scheduler.h index f2732203c46..4bc8c23b8a6 100644 --- a/llvm/tools/llvm-mca/Scheduler.h +++ b/llvm/tools/llvm-mca/Scheduler.h @@ -430,17 +430,16 @@ class Scheduler { // Notify the Backend that buffered resources were freed. void notifyReleasedBuffers(llvm::ArrayRef<uint64_t> Buffers); - /// Issue instructions from the ReadyQueue by giving priority to older - /// instructions. This method returns true if at least one instruction has - /// been promoted in the process from the WaitQueue to the ReadyQueue. + /// Issue the next instruction from the ReadyQueue. This method gives priority + /// to older instructions. bool issue(); - /// Scans the WaitQueue in search of instructions that can be moved to - /// the ReadyQueue. - bool promoteToReadyQueue(); + /// Move instructions from the WaitQueue to the ReadyQueue if input operands + /// are all available. + void promoteToReadyQueue(); /// Issue an instruction without updating the ready queue. - void issueInstruction(Instruction &IS, unsigned InstrIndex); + void issueInstruction(unsigned Index, Instruction &IS); void updatePendingQueue(); void updateIssuedQueue(); |