While looking at the -O0 codegen, I noticed that X86FastIsel doesn't know how to fast select bitcasts between 128-bit vetor types.
This patch is a (very) minor FastISel improvement.
It teaches FastISel the following two things:
- On SSE2, no instructions are needed for bitcasts between 128-bit vector types.
- On AVX, no instructions are needed for bitcasts between 256-bit vector types.
Example:
%1 = bitcast <4 x i32> %V to <2 x i64>
Before (-fast-isel -fast-isel-abort=1):
FastIsel miss: %1 = bitcast <4 x i32> %V to <2 x i64>
Now we don't fall back to SelectionDAG and we correctly fold that computation propagating the register associated to %V.
Please let me know if okay to submit.
Thanks,
Andrea
Why do we have to check that here?
We are interested in 128 and 256 bit vector types. I do not understand why the fact that f64 may be mapped on x87 need to be considered?