[PATCH] D132449: StructurizeCFG: prefer reduced number of live values

Ruiling, Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 01:38:38 PDT 2022


ruiling created this revision.
ruiling added reviewers: foad, critson, nhaehnle, sameerds.
Herald added subscribers: kosarev, kerbowa, hiraditya, tpr, jvesely, MatzeB.
Herald added a project: All.
ruiling requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The instruction simplification will try to simplify the affected phis.
In some cases, this might extend the liveness of values. For example:

  BB0:
   | \
   | BB1
   | /
  BB2:phi (BB0, v), (BB1, undef)

The phi in BB2 will be simplified to v as v dominates BB2, but this is
increasing the number of active values in BB1. By setting CanUseUndef
to false, we will not simplify the phi in this way, this would help
register pressure. This is mandatory for the later change to help
reducing VGPR pressure for AMDGPU.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132449

Files:
  llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
  llvm/test/CodeGen/AMDGPU/loop_break.ll
  llvm/test/CodeGen/AMDGPU/multi-divergent-exit-region.ll
  llvm/test/CodeGen/AMDGPU/multilevel-break.ll
  llvm/test/CodeGen/AMDGPU/nested-loop-conditions.ll
  llvm/test/CodeGen/AMDGPU/vgpr-liverange-ir.ll
  llvm/test/CodeGen/AMDGPU/while-break.ll
  llvm/test/Transforms/StructurizeCFG/AMDGPU/loop-subregion-misordered.ll
  llvm/test/Transforms/StructurizeCFG/interleaved-loop-order.ll
  llvm/test/Transforms/StructurizeCFG/loop-continue-phi.ll
  llvm/test/Transforms/StructurizeCFG/one-loop-multiple-backedges.ll
  llvm/test/Transforms/StructurizeCFG/workarounds/needs-fix-reducible.ll
  llvm/test/Transforms/StructurizeCFG/workarounds/needs-fr-ule.ll
  llvm/test/Transforms/StructurizeCFG/workarounds/needs-unified-loop-exits.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132449.454741.patch
Type: text/x-patch
Size: 60428 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220823/fd11efc2/attachment-0001.bin>


More information about the llvm-commits mailing list