[all-commits] [llvm/llvm-project] fa87dd: [AMDGPU] Handle multiple occurences of an incoming...

Pierre van Houtryve via All-commits all-commits at lists.llvm.org
Mon May 22 04:40:42 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fa87dd52d4327ad7313e924c1f27b9321fb253d2
      https://github.com/llvm/llvm-project/commit/fa87dd52d4327ad7313e924c1f27b9321fb253d2
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2023-05-22 (Mon, 22 May 2023)

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

  Log Message:
  -----------
  [AMDGPU] Handle multiple occurences of an incoming value in break large PHIs

We naively broke all incoming values, assuming they'd be unique.
However it's not illegal to have multiple occurences of, e.g. `[BB0, V0]`
in a PHI node. What's illegal though is having the same basic block
multiple times but with different values, and it's exactly what the
transform caused. This broke in some rare applications where the pattern
arised.

Now we cache the `BasicBlock, Value` pairs we're breaking so we can reuse the values and preserve this invariant.

Solves SWDEV-399460

Reviewed By: #amdgpu, rovka

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




More information about the All-commits mailing list