[PATCH] D33117: [AMDGPU] Cache live-ins and register pressure in scheduler

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 12 00:00:22 PDT 2017


rampitec created this revision.
Herald added subscribers: t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, kzhuravl, arsenm.

Using LIS can be quite expensive, so caching of calculated region
live-ins and pressure is implemented. It does two things:

1. Caches the info for the second stage when we schedule with decreased target occupancy.
2. Tracks the basic block from top to bottom thus eliminating the need to scan whole register file liveness at every region split in the middle of the block.

The scheduling is now done in 3 stages instead of two, with the first
one being really a no-op and only used to collect scheduling regions
as sent by the scheduler driver.

There is no functional change to the current behavior, only compilation
speed is affected. In general computeBlockPressure() could be simplified
if we switch to backward RP tracker, because scheduler sends regions
within a block starting from the last upward. We could use a natural
order of upward tracker to seamlessly change between regions of the same
block, since live reg set of a previous tracked region would become a
live-out of the next region. That however requires fixing upward tracker
to properly account defs and uses of the same instruction as both are
contributing to the current pressure. When we converge on the produced
pressure we should be able to switch between them back and forth. In
addition, backward tracker is less expensive as it uses LIS in recede
less often than forward uses it in advance.

At the moment the worst known case compilation time has improved from 26
minutes to 12.


Repository:
  rL LLVM

https://reviews.llvm.org/D33117

Files:
  lib/Target/AMDGPU/GCNRegPressure.cpp
  lib/Target/AMDGPU/GCNRegPressure.h
  lib/Target/AMDGPU/GCNSchedStrategy.cpp
  lib/Target/AMDGPU/GCNSchedStrategy.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33117.98728.patch
Type: text/x-patch
Size: 20823 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170512/d72b29dc/attachment.bin>


More information about the llvm-commits mailing list