1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt < %s -passes=loop-vectorize -force-vector-width=2 -S | FileCheck %s
5 ; CHECK-LABEL: define void @d() {
7 ; CHECK-NEXT: br i1 true, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
9 ; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]
11 ; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
12 ; CHECK-NEXT: [[TMP0:%.*]] = add i64 [[INDEX]], 0
13 ; CHECK-NEXT: [[TMP1:%.*]] = getelementptr float, ptr @d, i64 [[TMP0]]
14 ; CHECK-NEXT: [[TMP2:%.*]] = call <2 x i1> @llvm.is.fpclass.v2f32(<2 x float> zeroinitializer, i32 0)
15 ; CHECK-NEXT: [[TMP3:%.*]] = select <2 x i1> [[TMP2]], <2 x float> zeroinitializer, <2 x float> zeroinitializer
16 ; CHECK-NEXT: [[TMP4:%.*]] = getelementptr float, ptr [[TMP1]], i32 0
17 ; CHECK-NEXT: store <2 x float> [[TMP3]], ptr [[TMP4]], align 4
18 ; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 2
19 ; CHECK-NEXT: [[TMP5:%.*]] = icmp eq i64 [[INDEX_NEXT]], 0
20 ; CHECK-NEXT: br i1 [[TMP5]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]]
21 ; CHECK: middle.block:
22 ; CHECK-NEXT: br i1 true, label [[EXIT:%.*]], label [[SCALAR_PH]]
24 ; CHECK-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ 0, [[MIDDLE_BLOCK]] ], [ 0, [[ENTRY:%.*]] ]
25 ; CHECK-NEXT: br label [[LOOP:%.*]]
27 ; CHECK-NEXT: [[I:%.*]] = phi i64 [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[I7:%.*]], [[LOOP]] ]
28 ; CHECK-NEXT: [[I3:%.*]] = load float, ptr null, align 4
29 ; CHECK-NEXT: [[I4:%.*]] = getelementptr float, ptr @d, i64 [[I]]
30 ; CHECK-NEXT: [[I5:%.*]] = tail call i1 @llvm.is.fpclass.f32(float 0.000000e+00, i32 0)
31 ; CHECK-NEXT: [[I6:%.*]] = select i1 [[I5]], float 0.000000e+00, float 0.000000e+00
32 ; CHECK-NEXT: store float [[I6]], ptr [[I4]], align 4
33 ; CHECK-NEXT: [[I7]] = add i64 [[I]], 1
34 ; CHECK-NEXT: [[I8:%.*]] = icmp eq i64 [[I7]], 0
35 ; CHECK-NEXT: br i1 [[I8]], label [[EXIT]], label [[LOOP]], !llvm.loop [[LOOP3:![0-9]+]]
37 ; CHECK-NEXT: ret void
43 %i = phi i64 [ 0, %entry ], [ %i7, %loop ]
44 %i3 = load float, ptr null, align 4
45 %i4 = getelementptr float, ptr @d, i64 %i
46 %i5 = tail call i1 @llvm.is.fpclass.f32(float 0.0, i32 0)
47 %i6 = select i1 %i5, float 0.0, float 0.0
48 store float %i6, ptr %i4, align 4
50 %i8 = icmp eq i64 %i7, 0
51 br i1 %i8, label %exit, label %loop
57 declare i1 @llvm.is.fpclass.f32(float, i32 immarg)