[AMDGPU] Add missing use check in SIOptimizeExecMasking pass.
authorThomas Symalla <thomas.symalla@amd.com>
Thu, 31 Mar 2022 10:23:38 +0000 (12:23 +0200)
committerThomas Symalla <thomas.symalla@amd.com>
Thu, 31 Mar 2022 17:25:35 +0000 (19:25 +0200)
commit1a6aa8b1952b289c99adb83309ee7bc55b12fa97
treeae89ccbfaf3f39f7647fe36a1cf1f5641524c3c9
parent535211c3ebf057b3542dd41abdf5e1d4798b985f
[AMDGPU] Add missing use check in SIOptimizeExecMasking pass.

Whenever a v_cmp, s_and_saveexec instruction sequence shall be
transformed to an equivalent s_mov, v_cmpx sequence, it needs
to be detected if the v_cmp target register is used between
the two instructions as the v_cmp result gets omitted by
using the v_cmpx instruction, resulting in invalid code.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D122797
llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp
llvm/test/CodeGen/AMDGPU/vcmp-saveexec-to-vcmpx.mir