[all-commits] [llvm/llvm-project] b55672: [AMDGPU] Avoid flushing the vmcnt counter in loop ...

Baptiste Saleil via All-commits all-commits at lists.llvm.org
Wed Sep 28 10:06:33 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b556726ccc5670637e84f1b26ef7e998c94f1d42
      https://github.com/llvm/llvm-project/commit/b556726ccc5670637e84f1b26ef7e998c94f1d42
  Author: Baptiste <baptiste.saleil at amd.com>
  Date:   2022-09-28 (Wed, 28 Sep 2022)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
    M llvm/test/CodeGen/AMDGPU/waitcnt-vmcnt-loop.mir

  Log Message:
  -----------
  [AMDGPU] Avoid flushing the vmcnt counter in loop preheaders if not necessary

One of the conditions to flush the vmcnt counter in loop preheaders is: The loop
contains a use of a vgpr that is defined out of the loop. The code currently
checks if a waitcnt is needed by looking at the score of that vgpr in the score
brackets. This is not enough and may cause the generation of an unnecessary
vmcnt flush. This patch fixes that case.

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




More information about the All-commits mailing list