1; RUN: opt -S -loop-vectorize -force-vector-width=4 %s | FileCheck %s 2 3; CHECK-LABEL: @test_fshl 4; CHECK-LABEL: vector.body: 5; CHECK-NEXT: [[IDX:%.+]] = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] 6; CHECK-NEXT: [[IDX0:%.+]] = add i32 %index, 0 7; CHECK-NEXT: [[FSHL:%.+]] = call <4 x i16> @llvm.fshl.v4i16(<4 x i16> undef, <4 x i16> undef, <4 x i16> <i16 15, i16 15, i16 15, i16 15>) 8; CHECK-NEXT: [[GEP0:%.+]] = getelementptr inbounds i16, i16* %dst, i32 [[IDX0]] 9; CHECK-NEXT: [[GEP1:%.+]] = getelementptr inbounds i16, i16* [[GEP0]], i32 0 10; CHECK-NEXT: [[GEP_BC:%.+]] = bitcast i16* [[GEP1]] to <4 x i16>* 11; CHECK-NEXT: store <4 x i16> [[FSHL]], <4 x i16>* [[GEP_BC]], align 2 12; CHECK-NEXT: [[IDX_NEXT:%.+]] = add nuw i32 [[IDX]], 4 13; CHECK-NEXT: [[EC:%.+]] = icmp eq i32 [[IDX_NEXT]], %n.vec 14; CHECK-NEXT: br i1 [[EC]], label %middle.block, label %vector.body 15; 16define void @test_fshl(i32 %width, i16* %dst) { 17entry: 18 br label %for.body9.us.us 19 20for.cond6.for.cond.cleanup8_crit_edge.us.us: ; preds = %for.body9.us.us 21 ret void 22 23for.body9.us.us: ; preds = %for.body9.us.us, %entry 24 %iv = phi i32 [ 0, %entry ], [ %iv.next, %for.body9.us.us ] 25 %conv4.i.us.us = tail call i16 @llvm.fshl.i16(i16 undef, i16 undef, i16 15) 26 %dst.gep = getelementptr inbounds i16, i16* %dst, i32 %iv 27 store i16 %conv4.i.us.us, i16* %dst.gep 28 %iv.next = add nuw i32 %iv, 1 29 %exitcond50 = icmp eq i32 %iv.next, %width 30 br i1 %exitcond50, label %for.cond6.for.cond.cleanup8_crit_edge.us.us, label %for.body9.us.us 31} 32 33declare i16 @llvm.fshl.i16(i16, i16, i16) 34