[all-commits] [llvm/llvm-project] 1ceccb: VirtRegRewriter: Add implicit register defs for li...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Mon Oct 28 17:34:15 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1ceccbb0dd9d8539fec2213566fe6cc2a05b7993
      https://github.com/llvm/llvm-project/commit/1ceccbb0dd9d8539fec2213566fe6cc2a05b7993
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M llvm/include/llvm/CodeGen/LiveRegMatrix.h
    M llvm/lib/CodeGen/LiveRegMatrix.cpp
    M llvm/lib/CodeGen/VirtRegMap.cpp
    M llvm/test/CodeGen/AMDGPU/branch-folding-implicit-def-subreg.ll
    M llvm/test/CodeGen/AMDGPU/infloop-subrange-spill-inspect-subrange.mir
    M llvm/test/CodeGen/AMDGPU/infloop-subrange-spill.mir
    A llvm/test/CodeGen/AMDGPU/issue98474-assigned-physreg-interference.mir
    A llvm/test/CodeGen/AMDGPU/issue98474-need-live-out-undef-subregister-def.ll
    A llvm/test/CodeGen/AMDGPU/issue98474-virtregrewriter-live-out-undef-subregisters.mir
    A llvm/test/MachineVerifier/AMDGPU/issue98474-missing-def-liveout-physical-subregister.mir

  Log Message:
  -----------
  VirtRegRewriter: Add implicit register defs for live out undef lanes (#112679)

If an undef subregister def is live into another block, we need to
maintain a physreg def to track the liveness of those lanes. This
would manifest a verifier error after branch folding, when the cloned
tail block use no longer had a def.

We need to detect interference with other assigned intervals to avoid
clobbering the undef lanes defined in other intervals, since the undef
def didn't count as interference. This is pretty ugly and adds a new
dependency on LiveRegMatrix, keeping it live for one more pass. It also
adds a lot of implicit operand spam (we really should have a better
representation for this).

There is a missing verifier check for this situation. Added an xfailed
test that demonstrates this. We may also be able to revert the changes
in 47d3cbcf842a036c20c3f1c74255cdfc213f41c2.

It might be better to insert an IMPLICIT_DEF before the instruction
rather than using the implicit-def operand.

Fixes #98474



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list