[PATCH] D147786: [AMDGPU] Less aggressively break large PHIs

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 7 05:55:55 PDT 2023


Pierre-vh created this revision.
Pierre-vh added reviewers: arsenm, foad, rampitec, nhaehnle.
Herald added subscribers: kosarev, StephenFan, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
Pierre-vh requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

In some cases, breaking large PHIs can very negatively affect
performance (3x more instructions observed in a particular test case).

This patch adds some basic profitability heuristics to help with some of these issues without affecting the "good" cases.
e.g. avoid breaking PHIs if it causes back-and-forth between vector/scalar form for no good reason.

Fixes SWDEV-392803


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147786

Files:
  llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
  llvm/test/CodeGen/AMDGPU/agpr-copy-no-free-registers.ll
  llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-break-large-phis-heuristics.ll
  llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-break-large-phis.ll
  llvm/test/CodeGen/AMDGPU/extract-subvector-16bit.ll
  llvm/test/CodeGen/AMDGPU/insert_vector_elt.ll
  llvm/test/CodeGen/AMDGPU/loop-live-out-copy-undef-subrange.ll
  llvm/test/CodeGen/AMDGPU/mfma-loop.ll
  llvm/test/CodeGen/AMDGPU/wave32.ll
  llvm/test/CodeGen/AMDGPU/wqm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147786.511674.patch
Type: text/x-patch
Size: 94208 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230407/be04a990/attachment.bin>


More information about the llvm-commits mailing list