blob: 7ff0b90c65ddd1498f6fc313c2cd41bd1910aa0b [file] [log] [blame]
David Majnemerbc36b152016-07-27 02:39:16 +00001; RUN: opt -S -instsimplify < %s | FileCheck %s
David Majnemerbc36b152016-07-27 02:39:16 +00002%S = type { i16, i32 }
3
4define <2 x i16> @test1() {
5entry:
6 %b = insertelement <2 x i16> <i16 undef, i16 0>, i16 extractvalue (%S select (i1 icmp eq (i16 extractelement (<2 x i16> bitcast (<1 x i32> <i32 1> to <2 x i16>), i32 0), i16 0), %S zeroinitializer, %S { i16 0, i32 1 }), 0), i32 0
7 ret <2 x i16> %b
8}
9
Igor Laevskye0edb662017-12-13 11:21:18 +000010; InstCombine will be able to fold this into zeroinitializer
David Majnemerbc36b152016-07-27 02:39:16 +000011; CHECK-LABEL: @test1(
Igor Laevskye0edb662017-12-13 11:21:18 +000012; CHECK: ret <2 x i16> <i16 extractvalue (%S select (i1 icmp eq (i16 extractelement (<2 x i16> bitcast (<1 x i32> <i32 1> to <2 x i16>), i32 0), i16 0), %S zeroinitializer, %S { i16 0, i32 1 }), 0), i16 0>