[all-commits] [llvm/llvm-project] f32145: [ScheduleDAG] Dirty height/depth in addPred/remove...

Björn Pettersson via All-commits all-commits at lists.llvm.org
Tue Aug 20 04:38:39 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f321456e1aaff050a44698f1273da9589e74ebb4
      https://github.com/llvm/llvm-project/commit/f321456e1aaff050a44698f1273da9589e74ebb4
  Author: Björn Pettersson <bjorn.a.pettersson at ericsson.com>
  Date:   2024-08-20 (Tue, 20 Aug 2024)

  Changed paths:
    M llvm/lib/CodeGen/ScheduleDAG.cpp
    M llvm/test/CodeGen/AArch64/abds.ll

  Log Message:
  -----------
  [ScheduleDAG] Dirty height/depth in addPred/removePred even for latency zero (#102915)

A long time ago (back in 2009) there was a commit 52d4d8244b7c39c5cd
that changed the scheduler to not dirty height/depth when adding or
removing SUnit predecessors when the latency on the edge was zero. That
commit message is claiming that the depth or height isn't affected when
the latency is zero.

As a matter of fact, the depth/height can change even with a zero
latency on the edge. If for example adding a new SUnit A, with zero
latency, but as a predecessor to a SUnit B, then both height of A and
depth of B should be marked as dirty. If for example B has a greater
height than A, then the height of A needs to be adjusted even if the
latency is zero.

I think this has been wrong for many years. Downstream we have had
commit 52d4d8244b7c39c5cd reverted since back in 2016. There is no
motivating lit test for 52d4d8244b7c39c5cd (only an incomplete C level
reproducer in https://github.com/llvm/llvm-project/issues/3613).

After commit 13d04fa560e156797c21f1 there finally appeared an upstream
lit test that shows that we get better code if marking height/depth as
dirty (llvm/test/CodeGen/AArch64/abds.ll).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list