1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=instcombine < %s | FileCheck %s
4 ; instcombine shouldn't delete the shufflevector.
6 define internal void @0(ptr %arg, i32 %arg1, ptr %arg2) {
9 ; CHECK-NEXT: br label [[BB3:%.*]]
11 ; CHECK-NEXT: [[DOT0:%.*]] = phi i32 [ 0, [[BB:%.*]] ], [ [[I17:%.*]], [[BB4:%.*]] ]
12 ; CHECK-NEXT: [[I:%.*]] = icmp slt i32 [[DOT0]], [[ARG1:%.*]]
13 ; CHECK-NEXT: br i1 [[I]], label [[BB4]], label [[BB18:%.*]]
15 ; CHECK-NEXT: [[TMP0:%.*]] = sext i32 [[DOT0]] to i64
16 ; CHECK-NEXT: [[I5:%.*]] = getelementptr i8, ptr [[ARG2:%.*]], i64 [[TMP0]]
17 ; CHECK-NEXT: [[I71:%.*]] = load <1 x i64>, ptr [[I5]], align 1
18 ; CHECK-NEXT: [[I9:%.*]] = call <2 x i64> @foo(<1 x i64> [[I71]])
19 ; CHECK-NEXT: [[I11:%.*]] = bitcast <2 x i64> [[I9]] to <8 x i16>
20 ; CHECK-NEXT: [[I12:%.*]] = shufflevector <8 x i16> [[I11]], <8 x i16> poison, <8 x i32> <i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3>
21 ; CHECK-NEXT: [[I13:%.*]] = bitcast <8 x i16> [[I12]] to <4 x i32>
22 ; CHECK-NEXT: [[I14:%.*]] = sitofp <4 x i32> [[I13]] to <4 x float>
23 ; CHECK-NEXT: [[TMP2:%.*]] = sext i32 [[DOT0]] to i64
24 ; CHECK-NEXT: [[I15:%.*]] = getelementptr i8, ptr [[ARG:%.*]], i64 [[TMP2]]
25 ; CHECK-NEXT: store <4 x float> [[I14]], ptr [[I15]], align 1
26 ; CHECK-NEXT: [[I17]] = add i32 [[DOT0]], 1
27 ; CHECK-NEXT: br label [[BB3]]
29 ; CHECK-NEXT: call void @llvm.x86.mmx.emms()
30 ; CHECK-NEXT: ret void
35 bb3: ; preds = %bb4, %bb
36 %.0 = phi i32 [ 0, %bb ], [ %i17, %bb4 ]
37 %i = icmp slt i32 %.0, %arg1
38 br i1 %i, label %bb4, label %bb18
41 %i5 = getelementptr i8, ptr %arg2, i32 %.0
42 %i7 = load <4 x i16>, ptr %i5, align 1
43 %i8 = bitcast <4 x i16> %i7 to <1 x i64>
44 %i9 = call <2 x i64> @foo(<1 x i64> %i8)
45 %i10 = bitcast <2 x i64> %i9 to <4 x i32>
46 %i11 = bitcast <4 x i32> %i10 to <8 x i16>
47 %i12 = shufflevector <8 x i16> %i11, <8 x i16> %i11, <8 x i32> <i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3>
48 %i13 = bitcast <8 x i16> %i12 to <4 x i32>
49 %i14 = sitofp <4 x i32> %i13 to <4 x float>
50 %i15 = getelementptr i8, ptr %arg, i32 %.0
51 store <4 x float> %i14, ptr %i15, align 1
56 call void @llvm.x86.mmx.emms()
60 declare <2 x i64> @foo(<1 x i64>)
62 declare void @llvm.x86.mmx.emms() #0
64 attributes #0 = { nounwind }