[all-commits] [llvm/llvm-project] 2e1ad9: [AMDGPU] Fix copying a machine operand

Jay Foad via All-commits all-commits at lists.llvm.org
Mon Oct 11 12:26:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2e1ad93201e51ae0fc4529ac7a877443e2a5bd82
      https://github.com/llvm/llvm-project/commit/2e1ad93201e51ae0fc4529ac7a877443e2a5bd82
  Author: Jay Foad <jay.foad at amd.com>
  Date:   2021-10-11 (Mon, 11 Oct 2021)

  Changed paths:
    M llvm/lib/Target/AMDGPU/R600ISelLowering.cpp
    M llvm/test/CodeGen/AMDGPU/global-constant.ll

  Log Message:
  -----------
  [AMDGPU] Fix copying a machine operand

Without this I get:

*** Bad machine code: Instruction has operand with wrong parent set ***
- function:    available_externally_test
- basic block: %bb.0  (0x7dad598)
- instruction: %0:r600_treg32_x = MOV 1, 0, 0, 0, $alu_literal_x, 0, 0, 0, -1, 1, $pred_sel_off, @available_externally, 0

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


  Commit: edfdce2627633a161292c6ba46e868330569ee9d
      https://github.com/llvm/llvm-project/commit/edfdce2627633a161292c6ba46e868330569ee9d
  Author: Jay Foad <jay.foad at amd.com>
  Date:   2021-10-11 (Mon, 11 Oct 2021)

  Changed paths:
    M llvm/lib/CodeGen/PHIElimination.cpp
    A llvm/test/CodeGen/X86/phielim-undef.mir

  Log Message:
  -----------
  [PHIElimination] Fix accounting for undef uses when updating LiveVariables

PHI elimination updates LiveVariables info as described here:

    // We only need to update the LiveVariables kill of SrcReg if this was the
    // last PHI use of SrcReg to be lowered on this CFG edge and it is not live
    // out of the predecessor. We can also ignore undef sources.

Unfortunately if the last use also happened to be an undef use then it
would fail to update the LiveVariables at all. Fix this by not counting
undef uses in the VRegPHIUse map.

Thanks to Mikael Holmén for the test case!

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


Compare: https://github.com/llvm/llvm-project/compare/7af6a44077c1...edfdce262763


More information about the All-commits mailing list