beneficial optimization of undef examples needed

Hi Peter,

Undef is certainly useful for vector operations in the back end. It allows shorter instruction sequences for vectors which have some, but not all, elements marked as undef. Lowering vector shuffle as swap, combining arithmetic and similar.

For example, in slightly lispy notation, folding
(+ x (vector i32 undef 5))
and
(+ x (vector i32 4 undef))
to
(+ x (vector i32 4 5))

There should also be optimisations available for bitwise operations on machine words that are partially undef, but I haven’t written any yet.

Working with variables that are entirely undef is of less interest to me. For example, folding (add 5 undef) to undef leads to less code, but it’s still not code that does anything useful.

Cheers,

Jon