[all-commits] [llvm/llvm-project] 198e9d: [AMDGPU] SIFoldOperands: Delay foldCopyToVGPROfSca...

Fabian Ritter via All-commits all-commits at lists.llvm.org
Tue May 27 00:55:30 PDT 2025


  Branch: refs/heads/users/ritter-x2a/05-27-_amdgpu_sifoldoperands_delay_foldcopytovgprofscalaraddofframeindex
  Home:   https://github.com/llvm/llvm-project
  Commit: 198e9da6a12ff40e79e7aa212fcfe8e2bd2ef408
      https://github.com/llvm/llvm-project/commit/198e9da6a12ff40e79e7aa212fcfe8e2bd2ef408
  Author: Fabian Ritter <fabian.ritter at amd.com>
  Date:   2025-05-27 (Tue, 27 May 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
    M llvm/test/CodeGen/AMDGPU/flat-scratch-svs.ll

  Log Message:
  -----------
  [AMDGPU] SIFoldOperands: Delay foldCopyToVGPROfScalarAddOfFrameIndex

foldCopyToVGPROfScalarAddOfFrameIndex transforms s_adds whose results are copied
to vector registers into v_adds. We don't want to do that if foldInstOperand
(which so far runs later) can fold the sreg->vreg copy away.
This patch therefore delays foldCopyToVGPROfScalarAddOfFrameIndex until after
foldInstOperand.

This avoids unnecessary movs in the flat-scratch-svs.ll test and also avoids
regressions in an upcoming patch to enable ISD::PTRADD nodes.



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