The exit-on-error flag is necessary in order to avoid an unreachable in the DAGTypeLegalizer, when trying to expand a physical register. We can also avoid this situation by introducing a bitcast early on, where the invalid scalar-to-vector conversion is detected.
Fixes PR27765.
I take it that this transformation is harmless, since the compilation is going to fail anyway.
But I'm worried that this could trigger unrelated errors down the pipe until the last error is reported and the program exits, and confuse the user.