[ARM] Remove dead instructions before creating VPT block bundles
authorDavid Green <david.green@arm.com>
Tue, 8 Dec 2020 14:05:07 +0000 (14:05 +0000)
committerDavid Green <david.green@arm.com>
Tue, 8 Dec 2020 14:05:07 +0000 (14:05 +0000)
commit91fb9eac0b562cdfdc6b677f8ab2ee67f1ae1a77
treeec8443f7e67351512f85744db9e4ce3733f6864a
parent59f17b57d9c9abf86d8dcc05c49d3bbd807e29c7
[ARM] Remove dead instructions before creating VPT block bundles

We remove VPNOT instructions in VPT blocks as we create them, turning
them into else predicates. We don't remove the dead instructions until
after the block has been created though. Because the VPNOT will have
killed the vpr register it used, this makes finalizeBundle add internal
flags to the vpr uses of any instructions after the VPNOT. These
incorrect flags can then confuse what is alive and what is not, leading
to machine verifier problems.

This patch removes them earlier instead, before the bundle is finalized
so that kill flags remain valid.

Differential Revision: https://reviews.llvm.org/D92227
llvm/lib/Target/ARM/MVEVPTBlockPass.cpp
llvm/test/CodeGen/Thumb2/mve-vpt-3-blocks-kill-vpr.mir