[all-commits] [llvm/llvm-project] 9d72c0: [AMDGPU] Mark waterfall loops as SI_WATERFALL_LOOP

Sebastian Neubauer via All-commits all-commits at lists.llvm.org
Tue Jul 13 03:15:34 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9d72c0ad43e720ef2394a23a2f4c58f79d753f03
      https://github.com/llvm/llvm-project/commit/9d72c0ad43e720ef2394a23a2f4c58f79d753f03
  Author: Sebastian Neubauer <sebastian.neubauer at amd.com>
  Date:   2021-07-13 (Tue, 13 Jul 2021)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
    M llvm/lib/Target/AMDGPU/SIInstructions.td
    M llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
    M llvm/test/CodeGen/AMDGPU/mubuf-legalize-operands.mir

  Log Message:
  -----------
  [AMDGPU] Mark waterfall loops as SI_WATERFALL_LOOP

This way, they can be detected later, e.g. by the
SIOptimizeVGPRLiveRange pass.

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


  Commit: ad2c66ec5d4bb0425625155bba966732ef85e6e5
      https://github.com/llvm/llvm-project/commit/ad2c66ec5d4bb0425625155bba966732ef85e6e5
  Author: Sebastian Neubauer <sebastian.neubauer at amd.com>
  Date:   2021-07-13 (Tue, 13 Jul 2021)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIOptimizeVGPRLiveRange.cpp
    M llvm/test/CodeGen/AMDGPU/image-sample-waterfall.ll
    M llvm/test/CodeGen/AMDGPU/indirect-call.ll
    M llvm/test/CodeGen/AMDGPU/llvm.amdgcn.struct.buffer.load.format.v3f16.ll
    M llvm/test/CodeGen/AMDGPU/vgpr-descriptor-waterfall-loop-idom-update.ll

  Log Message:
  -----------
  [AMDGPU] Optimize VGPR LiveRange in waterfall loops

The loops are run exactly once per lane, so VGPRs do not need to be
saved. Use the SIOptimizeVGPRLiveRange pass to add phi nodes that take
undef when coming from the loop.

There is still a shortcoming:
Return values from a function call in the loop are copied because their
live range conflicts with the live range of arguments, even if arguments
are only IMPLICIT_DEF after the phi insertion.

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


Compare: https://github.com/llvm/llvm-project/compare/78463ebde2f8...ad2c66ec5d4b


More information about the All-commits mailing list