This extends the (X & ~Y) | Y to X | Y fold to also work if ~Y is a truncated not (when taking into account the mask X). This is done by exporting the infrastructure added in D124856 and reusing it here.
I've retained the old value of AllowUndefs=false, though probably this can be switched to true with extra test coverage.
note -> node