[all-commits] [llvm/llvm-project] a04603: AMDGPU: Duplicate instead of COPY constants from V...

Diana via All-commits all-commits at lists.llvm.org
Mon Sep 25 04:20:21 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a04603993b43e5ebac1531293d288315f1885886
      https://github.com/llvm/llvm-project/commit/a04603993b43e5ebac1531293d288315f1885886
  Author: Diana <rovka at users.noreply.github.com>
  Date:   2023-09-25 (Mon, 25 Sep 2023)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp
    M llvm/test/CodeGen/AMDGPU/fix-sgpr-copies.mir

  Log Message:
  -----------
  AMDGPU: Duplicate instead of COPY constants from VGPR to SGPR (#66882)

Teach the si-fix-sgpr-copies pass to deal with REG_SEQUENCE, PHI or
INSERT_SUBREG where the result is an SGPR, but some of the inputs are
constants materialized into VGPRs. This may happen in cases where for
instance several instructions use an immediate zero and SelectionDAG
chooses to put it in a VGPR to satisfy all of them. This however causes
the si-fix-sgpr-copies to try to switch the whole chain to VGPR and may
lead to illegal VGPR-to-SGPR copies. Rematerializing the constant into
an SGPR fixes the issue.




More information about the All-commits mailing list