1 ; RUN: opt -passes=instcombine -S < %s | FileCheck %s
3 ; We shouldn't fold bitcast(insert <vscale x 1 x iX> .., iX %val, i32 0)
4 ; into bitcast(iX %val) for scalable vectors.
5 define <vscale x 2 x i8> @bitcast_of_insert_i8_i16(i16 %val) #0 {
6 ; CHECK-LABEL: @bitcast_of_insert_i8_i16(
7 ; CHECK-NOT: bitcast i16 %val to <vscale x 2 x i8>
8 ; CHECK: bitcast <vscale x 1 x i16> %op2 to <vscale x 2 x i8>
10 %op2 = insertelement <vscale x 1 x i16> undef, i16 %val, i32 0
11 %0 = bitcast <vscale x 1 x i16> %op2 to <vscale x 2 x i8>
12 ret <vscale x 2 x i8> %0