The assert would fail if there was a dead def of a subregister if
there was a previous use of a different subregister.
The check is not quite right I think see inline comment (you should be able to write a test case to expose the issue), but the direction is the right one).
With that fixed LGTM.
We should check that the lane masks don't overlap instead.