Fix reordering of instructions during VirtRegRewriter unbundling
authorCarl Ritson <carl.ritson@amd.com>
Tue, 6 Oct 2020 00:31:30 +0000 (09:31 +0900)
committerCarl Ritson <carl.ritson@amd.com>
Tue, 6 Oct 2020 00:43:02 +0000 (09:43 +0900)
commitea9d6392f4a375b5183be02ac93eb3a75c169360
tree24b1101d5d140065f277425b5091c3086ef0fa74
parenta48d480e1f7ebc5d5f93507fe1f519496621e259
Fix reordering of instructions during VirtRegRewriter unbundling

When unbundling COPY bundles in VirtRegRewriter the start of the
bundle is not correctly referenced in the unbundling loop.

The effect of this is that unbundled instructions are sometimes
inserted out-of-order, particular in cases where multiple
reordering have been applied to avoid clobbering dependencies.
The resulting instruction sequence clobbers dependencies.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D88821
llvm/lib/CodeGen/VirtRegMap.cpp
llvm/test/CodeGen/AMDGPU/splitkit-copy-bundle.mir