[all-commits] [llvm/llvm-project] 4c0251: [AMDGPU] Enable SGPR copy folding

Stanislav Mekhanoshin via All-commits all-commits at lists.llvm.org
Fri Oct 25 15:09:04 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4c0251da149c99f49550d6c938e6e7f45075194d
      https://github.com/llvm/llvm-project/commit/4c0251da149c99f49550d6c938e6e7f45075194d
  Author: Stanislav Mekhanoshin <Stanislav.Mekhanoshin at amd.com>
  Date:   2019-10-25 (Fri, 25 Oct 2019)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
    M llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
    A llvm/test/CodeGen/AMDGPU/fold-sgpr-copy.mir

  Log Message:
  -----------
  [AMDGPU] Enable SGPR copy folding

That used to fail in the last testcase function because after
%0:sreg_64.sub0 was folded into %3:sreg_32_xm0_xexec COPY, it
was further folded into S_STORE_DWORD_IMM. Its legal effective
subreg class is SReg_32 while instruction expects more restricted
SReg_32_XM0_EXEC. However, SIInstrInfo::isLegalRegOperand()
passed the legality check and it was caught in the verifier.

Borrowed code from the verifier to check for RC legality.

Differential Revision: https://reviews.llvm.org/D69445




More information about the All-commits mailing list