Unbundle KILL bundles in VirtRegRewriter
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Fri, 7 Aug 2020 19:56:09 +0000 (12:56 -0700)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Mon, 10 Aug 2020 18:58:37 +0000 (11:58 -0700)
commit08803f0e62e82539756b94e2655dabdbdab39014
tree8e2cd111c2374e18906e96e45d1596f85ac12475
parent7f5928ef5a5743ee7e65c6c9d1e1c9bc6af03063
Unbundle KILL bundles in VirtRegRewriter

SplitKit forms invalid COPY subreg bundles without a leading
BUNDLE instruction. That manifests itself in post-RA scheduler
counting instruction and asserting on "Instruction count mismatch".

The bundle shall be undone by VirtRegRewriter::expandCopyBundle(),
but it does not because VirtRegRewriter::handleIdentityCopy() can
turn COPY bundle into a KILL bundle.

Process KILLs as well.

Differential Revision: https://reviews.llvm.org/D85484
llvm/lib/CodeGen/VirtRegMap.cpp
llvm/test/CodeGen/AMDGPU/splitkit-copy-bundle.mir [new file with mode: 0644]