Following https://github.com/llvm/llvm-project/issues/52817#issuecomment-1007635426, this excludes debug instructions when finalizing the bundle. Uses in debug instructions will no longer be included in the BUNDLE header.
This also ends up dropping the "internal" modifier for debug instructions -- not sure whether that's good or bad. If that should be retained, I can change the patch accordingly.
Does checking MO.readsReg() work as well? I looks like we may have a similar problem with undef operands.