[AMDGPU] Fix copying a machine operand
authorJay Foad <jay.foad@amd.com>
Mon, 11 Oct 2021 14:11:36 +0000 (15:11 +0100)
committerJay Foad <jay.foad@amd.com>
Mon, 11 Oct 2021 19:22:47 +0000 (20:22 +0100)
commit2e1ad93201e51ae0fc4529ac7a877443e2a5bd82
tree3a7708d2e6c1a632963b5775375fea1bd25e96a9
parent7af6a44077c164e59bf6787864e73a5e8d287629
[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
llvm/lib/Target/AMDGPU/R600ISelLowering.cpp
llvm/test/CodeGen/AMDGPU/global-constant.ll