35 lines · plain
1; RUN: opt -S -passes=loop-vectorize -force-vector-width=4 %s | FileCheck %s2 3; CHECK-LABEL: @test_fshl4; CHECK-LABEL: vector.body:5; CHECK-NEXT: [[IDX:%.+]] = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]6; CHECK-NEXT: [[GEP:%.+]] = getelementptr inbounds i16, ptr %src, i32 %index7; CHECK-NEXT: [[WIDE_LOAD:%.+]] = load <4 x i16>, ptr [[GEP]], align 28; CHECK-NEXT: [[FSHL:%.+]] = call <4 x i16> @llvm.fshl.v4i16(<4 x i16> [[WIDE_LOAD]], <4 x i16> [[WIDE_LOAD]], <4 x i16> splat (i16 15))9; CHECK-NEXT: [[GEP0:%.+]] = getelementptr inbounds i16, ptr %dst, i32 %index10; CHECK-NEXT: store <4 x i16> [[FSHL]], ptr [[GEP0]], align 211; CHECK-NEXT: [[IDX_NEXT:%.+]] = add nuw i32 [[IDX]], 412; CHECK-NEXT: [[EC:%.+]] = icmp eq i32 [[IDX_NEXT]], %n.vec13; CHECK-NEXT: br i1 [[EC]], label %middle.block, label %vector.body14;15define void @test_fshl(i32 %width, ptr %dst, ptr %src) {16entry:17 br label %for.body9.us.us18 19for.cond6.for.cond.cleanup8_crit_edge.us.us: ; preds = %for.body9.us.us20 ret void21 22for.body9.us.us: ; preds = %for.body9.us.us, %entry23 %iv = phi i32 [ 0, %entry ], [ %iv.next, %for.body9.us.us ]24 %gep = getelementptr inbounds i16, ptr %src, i32 %iv25 %l = load i16, ptr %gep26 %conv4.i.us.us = tail call i16 @llvm.fshl.i16(i16 %l, i16 %l, i16 15)27 %dst.gep = getelementptr inbounds i16, ptr %dst, i32 %iv28 store i16 %conv4.i.us.us, ptr %dst.gep29 %iv.next = add nuw i32 %iv, 130 %exitcond50 = icmp eq i32 %iv.next, %width31 br i1 %exitcond50, label %for.cond6.for.cond.cleanup8_crit_edge.us.us, label %for.body9.us.us32}33 34declare i16 @llvm.fshl.i16(i16, i16, i16)35