MCP: Fixed bug with dest overlapping copy source
authorTim Renouf <tpr.ll@botech.co.uk>
Mon, 11 Nov 2019 11:06:09 +0000 (11:06 +0000)
committerTim Renouf <tim.renouf@amd.com>
Tue, 12 Nov 2019 08:18:11 +0000 (08:18 +0000)
commit07ebd741546e399f3db0a7c08a7fb1932e14080c
treebd3988c86442a72d6bfa7b35d278c5baef271736
parent22a535e91a795e52c8b8c01ad04e3577e9f7ae5b
MCP: Fixed bug with dest overlapping copy source

In MachineCopyPropagation, when propagating the source of a copy into
the operand of a later instruction, bail if a destination overlaps
(partly defines) the copy source. If the instruction where the
substitution is happening is also a copy, allowing the propagation
confuses the tracking mechanism.

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

Change-Id: Ic570754f878f2d91a4a50a9bdcf96fbaa240726d
llvm/lib/CodeGen/MachineCopyPropagation.cpp
llvm/test/CodeGen/AMDGPU/mcp-overlap-after-propagation.mir [new file with mode: 0644]