[all-commits] [llvm/llvm-project] f5bdc8: [MCA] Improved handling of negative read-advance c...

Andrea Di Biagio via All-commits all-commits at lists.llvm.org
Tue Mar 23 07:49:25 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f5bdc88e4d2b096414d0ac1781840a6c73e9f3a3
      https://github.com/llvm/llvm-project/commit/f5bdc88e4d2b096414d0ac1781840a6c73e9f3a3
  Author: Andrea Di Biagio <andrea.dibiagio at sony.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h
    M llvm/include/llvm/MCA/Instruction.h
    M llvm/include/llvm/MCA/Stages/RetireStage.h
    M llvm/lib/MCA/HardwareUnits/RegisterFile.cpp
    M llvm/lib/MCA/Instruction.cpp
    M llvm/lib/MCA/Stages/DispatchStage.cpp
    M llvm/lib/MCA/Stages/InOrderIssueStage.cpp
    M llvm/lib/MCA/Stages/RetireStage.cpp
    A llvm/test/tools/llvm-mca/X86/BtVer2/negative-read-advance.s

  Log Message:
  -----------
  [MCA] Improved handling of negative read-advance cycles.

Before this patch, register writes were always invalidated by the
RegisterFile at instruction commit stage. So,
the RegisterFile was often losing the knowledge about the `execute
cycle` of writes already committed. While this was not problematic
for non-delayed reads, this was sometimes leading to inaccurate read
latency computations in the presence of negative read-advance cycles.

This patch fixes the issue by changing how the RegisterFile component
internally keeps track of the `execute cycle` information of each
write. On every instruction executed, the RegisterFile gets notified
by the RetireStage, so that it can internally record the execute
cycle of each executed write.
The `execute cycle` information is stored within WriteRef itself, and
it is not invalidated when the write is committed.




More information about the All-commits mailing list