[all-commits] [llvm/llvm-project] 814a0a: AMDGPU: allow reordering of functions in AMDGPURes...

Jacob Weightman via All-commits all-commits at lists.llvm.org
Fri Jun 3 13:56:29 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 814a0abccefdd2e52b1b507f21ce842b689dbedd
      https://github.com/llvm/llvm-project/commit/814a0abccefdd2e52b1b507f21ce842b689dbedd
  Author: Jacob Weightman <jacobdweightman at gmail.com>
  Date:   2022-06-03 (Fri, 03 Jun 2022)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp
    A llvm/test/CodeGen/AMDGPU/hsa-metadata-resource-usage-function-ordering.ll

  Log Message:
  -----------
  AMDGPU: allow reordering of functions in AMDGPUResourceUsageAnalysis

The AMDGPUResourceUsageAnalysis was previously a CGSCC pass, and assumed
that a function's callees were always analyzed prior to their callees.
When it was refactored into a module pass, this assumption no longer
always holds. This results in calls being erroneously identified as
indirect, and reserving private segment space for them. This results in
significantly slower kernel launch latency.

This patch changes the order in which the module's functions are analyzed
from the order in which they occur in the module to a post-order traversal
of the call graph. Perhaps Clang always generates the module's functions
in such an order, but this is not the case for the Cray Fortran compiler.

Reviewed By: #amdgpu, arsenm

Differential Revision: https://reviews.llvm.org/D126025




More information about the All-commits mailing list