Extended Description
define <4 x i32> @bitcasts(<4 x i32> %a, <8 x i16> %b) {
%bc1 = bitcast <4 x i32> %a to <2 x i64>
%bc2 = bitcast <8 x i16> %b to <2 x i64>
%and = and <2 x i64> %bc2, %bc1
%bc3 = bitcast <2 x i64> %and to <4 x i32>
ret <4 x i32> %bc3
}
By transforming the 'and' to <4 x i32> type, we eliminate 2 bitcasts:
define <4 x i32> @bitcasts(<4 x i32> %a, <8 x i16> %b) {
%bc2 = bitcast <8 x i16> %b to <4 x i32>
%and = and <4 x i32> %a, %bc2
ret <4 x i32> %and
}
Should this be limited to vector types?