[PATCH] D155184: [AMDGPU] Relax restrictions on unbreakable PHI users in BreakLargePHis

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 04:50:05 PDT 2023


Pierre-vh created this revision.
Pierre-vh added reviewers: AMDGPU, arsenm.
Herald added subscribers: foad, 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.

The previous heuristic rejected a PHI if one of its user was an unbreakable PHI, no matter what the other users were.

This worked well in most cases, but there's one case in rocRAND where
it doesn't work. In that case, a PHI node has 2 PHI users where one is
breakable but not the other. When that PHI node isn't broken performance falls by 35%.

Relaxing the restriction to "require that  half of the PHI node users are breakable" fixes the issue, and seems like a sensible change.

Solves SWDEV-409648, SWDEV-398393


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155184

Files:
  llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
  llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-break-large-phis-heuristics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155184.539960.patch
Type: text/x-patch
Size: 6559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230713/59ecabea/attachment.bin>


More information about the llvm-commits mailing list