[PATCH] D101939: [AMDGPU] Disable the SIFormMemoryClauses pass at -O1

Baptiste Saleil via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 7 08:24:44 PDT 2021


bsaleil added a comment.

In D101939#2741529 <https://reviews.llvm.org/D101939#2741529>, @foad wrote:

> In D101939#2740008 <https://reviews.llvm.org/D101939#2740008>, @arsenm wrote:
>
>> Can we address it being slow instead of just turning of everything that is? There's no reason it should be slow, but the way it uses liveness information is horrible
>
> On small functions I think the run time of this pass is dominated by the two calls to TRI->getAllocatableSet, which means two identical calls to SIRegisterInfo::getReservedRegs, which has a very large fixed cost. Is there some way the Reserved register set can be cached (in the SIMachineFunctionInfo object?)?

@foad you're right. But caching the result of `getReservedRegs` is not easy because it difficult to detect that the calls are from consecutive calls to `getAllocatableSet`. I instead added the `TargetRegisterInfo::getAllocatableSets` method allowing to get allocatable sets for multiple register classes so we can call `getReservedRegs` a single time for all the classes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101939/new/

https://reviews.llvm.org/D101939



More information about the llvm-commits mailing list