[all-commits] [llvm/llvm-project] 2032d3: CodeGen: Trim each PHI source subregister lane at ...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Thu Sep 24 08:45:41 PDT 2026


  Branch: refs/heads/users/arsenm/codegen/phi-elim-per-lane-kill
  Home:   https://github.com/llvm/llvm-project
  Commit: 2032d3add9a84c749a9519ab62c62b4a2784136e
      https://github.com/llvm/llvm-project/commit/2032d3add9a84c749a9519ab62c62b4a2784136e
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2026-09-24 (Thu, 24 Sep 2026)

  Changed paths:
    M llvm/lib/CodeGen/PHIElimination.cpp
    A llvm/test/CodeGen/Hexagon/phi-elim-subreg-lanes.mir

  Log Message:
  -----------
  CodeGen: Trim each PHI source subregister lane at its own last read

This fixes verifier errors when LiveIntervals is computed in SSA.

Eliminating a PHI with LiveIntervals available, it shortens the live range
of the source register to its last read in the predecessor block, and shortened
each subrange to that same point. That is wrong when several PHIs read different
subregisters of the same source value: each lane's real last read is a different
one of the inserted copies, so trimming all of them at the last read of the whole
register leaves the earlier lanes live past their final use. The verifier rejects
this with "Instruction ending live segment doesn't read the register".

The per-lane read points cannot be recovered from the original live ranges, so
the new subreg copies need to be tracked.

Co-Authored-By: Claude Opus 5 <noreply at anthropic.com>



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