[MachineSink] Don't reject sinking because of dead def in isProfitableToSinkTo().
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Fri, 12 May 2023 13:12:46 +0000 (15:12 +0200)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Tue, 16 May 2023 08:00:44 +0000 (10:00 +0200)
commit64599ac97eb1346dcc0e45b722c4a84c8c72e899
treeffc1ee07da4104856c57be23bea4838500ac1dfd
parenta27fd12f92f81dbee039e1cccbd0b686b8b42da7
[MachineSink] Don't reject sinking because of dead def in isProfitableToSinkTo().

An instruction should be sunk (if otherwise legal and profitable) regardless
of if it has a dead def of a physreg or not. Physreg defs are checked in other
places and sinking is only done with dead defs of regs that are not live into
the target MBB.

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

Reviewed By: sebastian-ne, arsenm
llvm/lib/CodeGen/MachineSink.cpp
llvm/test/CodeGen/AMDGPU/collapse-endcf.ll
llvm/test/CodeGen/AMDGPU/loop_exit_with_xor.ll
llvm/test/CodeGen/AMDGPU/should-not-hoist-set-inactive.ll
llvm/test/CodeGen/SystemZ/machinesink-dead-cc.mir [new file with mode: 0644]
llvm/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll
llvm/test/CodeGen/X86/dag-update-nodetomatch.ll
llvm/test/CodeGen/X86/statepoint-cmp-sunk-past-statepoint.ll