[all-commits] [llvm/llvm-project] 8061cf: [PHIElimination] Account for PHI operands that app...

Guy David via All-commits all-commits at lists.llvm.org
Thu Jul 3 01:48:57 PDT 2025


  Branch: refs/heads/users/guy-david/phi-elimination-operand-multi-use
  Home:   https://github.com/llvm/llvm-project
  Commit: 8061cf9797601a2624e1bb8188a8cd519e714071
      https://github.com/llvm/llvm-project/commit/8061cf9797601a2624e1bb8188a8cd519e714071
  Author: Guy David <guyda96 at gmail.com>
  Date:   2025-07-03 (Thu, 03 Jul 2025)

  Changed paths:
    M llvm/lib/CodeGen/PHIElimination.cpp
    M llvm/test/CodeGen/AArch64/PHIElimination-reuse-copy.mir
    M llvm/test/CodeGen/PowerPC/vsx.ll

  Log Message:
  -----------
  [PHIElimination] Account for PHI operands that appear more than once

During lowering, the PHI instruction is detached from the function and
thus it is not considered a user of its operands.
The previous implementation, which removed redundant COPY of COPY
instructions, skipped values which had any uses, because otherwise it
can break the function. However, it had a hidden assumption that there's
a single use for that operand in the detached PHI instruction.
By not taking into account that an operand can be referenced more than
once, it interfered with itself and created IMPLICIT_DEF's for some
incoming values instead of copying the correct ones.



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