[MachineSink] Fix for breaking phi edges with instructions with multiple defs
authorDavid Green <david.green@arm.com>
Thu, 16 Apr 2020 14:23:49 +0000 (15:23 +0100)
committerDavid Green <david.green@arm.com>
Thu, 16 Apr 2020 15:42:07 +0000 (16:42 +0100)
commit44c4ba34d001dcf538d7396007b5611d6f697f86
tree1fdb0d7179d55eefe867255a581f3116b9059bf8
parentea88dd821253103a07f335449416e55034e7d8b3
[MachineSink] Fix for breaking phi edges with instructions with multiple defs

BreakPHIEdge would be set based on whether the instruction needs to
insert a new critical edge to allow sinking into a block where the uses
are PHI nodes. But for instructions with multiple defs it would be reset
on the second def, allowing the instruciton to sink where it should not.

Fixes PR44981

Differential Revision: https://reviews.llvm.org/D78087
llvm/lib/CodeGen/MachineSink.cpp
llvm/test/CodeGen/ARM/machine-sink-multidef.ll [new file with mode: 0644]