[llvm] r346658 - [LoopVectorize] add tests for funnel shifts; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 12 06:52:01 PST 2018
Author: spatel
Date: Mon Nov 12 06:52:01 2018
New Revision: 346658
URL: http://llvm.org/viewvc/llvm-project?rev=346658&view=rev
Log:
[LoopVectorize] add tests for funnel shifts; NFC
Modified:
llvm/trunk/test/Transforms/LoopVectorize/intrinsic.ll
Modified: llvm/trunk/test/Transforms/LoopVectorize/intrinsic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopVectorize/intrinsic.ll?rev=346658&r1=346657&r2=346658&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LoopVectorize/intrinsic.ll (original)
+++ llvm/trunk/test/Transforms/LoopVectorize/intrinsic.ll Mon Nov 12 06:52:01 2018
@@ -1192,6 +1192,58 @@ for.end:
ret void
}
+declare i32 @llvm.fshl.i32 (i32, i32, i32)
+
+define void @fshl_i32(i32 %n, i32* noalias %x, i32* noalias %y, i32 %shAmt) {
+; CHECK-LABEL: @fshl_i32(
+; CHECK-NOT: call <4 x i32> @llvm.fshl.v4i32(<4 x i32> [[WIDE_LOADX:%.*]], <4 x i32> [[WIDE_LOADY:%.*]], <4 x i32> [[SPLAT:%.*]])
+; CHECK: ret void
+entry:
+ %cmp = icmp sgt i32 %n, 0
+ br i1 %cmp, label %loop, label %end
+
+loop:
+ %iv = phi i32 [ %iv.next, %loop ], [ 0, %entry ]
+ %xi = getelementptr inbounds i32, i32* %x, i32 %iv
+ %yi = getelementptr inbounds i32, i32* %y, i32 %iv
+ %xld = load i32, i32* %xi, align 4
+ %yld = load i32, i32* %yi, align 4
+ %call = tail call i32 @llvm.fshl.i32(i32 %xld, i32 %yld, i32 %shAmt)
+ store i32 %call, i32* %xi, align 4
+ %iv.next = add i32 %iv, 1
+ %exitcond = icmp eq i32 %iv.next, %n
+ br i1 %exitcond, label %end, label %loop
+
+end:
+ ret void
+}
+
+declare i32 @llvm.fshr.i32 (i32, i32, i32)
+
+define void @fshr_i32(i32 %n, i32* noalias %x, i32* noalias %y, i32 %shAmt) {
+; CHECK-LABEL: @fshr_i32(
+; CHECK-NOT: call <4 x i32> @llvm.fshr.v4i32(<4 x i32> [[WIDE_LOADX:%.*]], <4 x i32> [[WIDE_LOADY:%.*]], <4 x i32> [[SPLAT:%.*]])
+; CHECK: ret void
+entry:
+ %cmp = icmp sgt i32 %n, 0
+ br i1 %cmp, label %loop, label %end
+
+loop:
+ %iv = phi i32 [ %iv.next, %loop ], [ 0, %entry ]
+ %xi = getelementptr inbounds i32, i32* %x, i32 %iv
+ %yi = getelementptr inbounds i32, i32* %y, i32 %iv
+ %xld = load i32, i32* %xi, align 4
+ %yld = load i32, i32* %yi, align 4
+ %call = tail call i32 @llvm.fshr.i32(i32 %xld, i32 %yld, i32 %shAmt)
+ store i32 %call, i32* %xi, align 4
+ %iv.next = add i32 %iv, 1
+ %exitcond = icmp eq i32 %iv.next, %n
+ br i1 %exitcond, label %end, label %loop
+
+end:
+ ret void
+}
+
declare float @llvm.minnum.f32(float, float) nounwind readnone
;CHECK-LABEL: @minnum_f32(
More information about the llvm-commits
mailing list