[llvm] a0ebac4 - [InstSimplify] add tests for rotates of 0/-1; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 22 06:21:59 PDT 2021
Author: Sanjay Patel
Date: 2021-08-22T09:15:48-04:00
New Revision: a0ebac4466f140d193457fabb2e41b5f1fb98b9b
URL: https://github.com/llvm/llvm-project/commit/a0ebac4466f140d193457fabb2e41b5f1fb98b9b
DIFF: https://github.com/llvm/llvm-project/commit/a0ebac4466f140d193457fabb2e41b5f1fb98b9b.diff
LOG: [InstSimplify] add tests for rotates of 0/-1; NFC
Added:
Modified:
llvm/test/Transforms/InstSimplify/call.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstSimplify/call.ll b/llvm/test/Transforms/InstSimplify/call.ll
index 8b9a8cb63d8d..caf9fcf68b10 100644
--- a/llvm/test/Transforms/InstSimplify/call.ll
+++ b/llvm/test/Transforms/InstSimplify/call.ll
@@ -958,6 +958,42 @@ define i9 @fshr_ops_poison6() {
ret i9 %r
}
+define i8 @fshl_zero(i8 %shamt) {
+; CHECK-LABEL: @fshl_zero(
+; CHECK-NEXT: [[R:%.*]] = call i8 @llvm.fshl.i8(i8 0, i8 0, i8 [[SHAMT:%.*]])
+; CHECK-NEXT: ret i8 [[R]]
+;
+ %r = call i8 @llvm.fshl.i8(i8 0, i8 0, i8 %shamt)
+ ret i8 %r
+}
+
+define <2 x i8> @fshr_zero_vec(<2 x i8> %shamt) {
+; CHECK-LABEL: @fshr_zero_vec(
+; CHECK-NEXT: [[R:%.*]] = call <2 x i8> @llvm.fshr.v2i8(<2 x i8> zeroinitializer, <2 x i8> <i8 0, i8 undef>, <2 x i8> [[SHAMT:%.*]])
+; CHECK-NEXT: ret <2 x i8> [[R]]
+;
+ %r = call <2 x i8> @llvm.fshr.v2i8(<2 x i8> zeroinitializer, <2 x i8> <i8 0, i8 undef>, <2 x i8> %shamt)
+ ret <2 x i8> %r
+}
+
+define <2 x i7> @fshl_ones_vec(<2 x i7> %shamt) {
+; CHECK-LABEL: @fshl_ones_vec(
+; CHECK-NEXT: [[R:%.*]] = call <2 x i7> @llvm.fshl.v2i7(<2 x i7> <i7 undef, i7 -1>, <2 x i7> <i7 -1, i7 undef>, <2 x i7> [[SHAMT:%.*]])
+; CHECK-NEXT: ret <2 x i7> [[R]]
+;
+ %r = call <2 x i7> @llvm.fshl.v2i7(<2 x i7> <i7 undef, i7 -1>, <2 x i7> <i7 -1, i7 undef>, <2 x i7> %shamt)
+ ret <2 x i7> %r
+}
+
+define i9 @fshr_ones(i9 %shamt) {
+; CHECK-LABEL: @fshr_ones(
+; CHECK-NEXT: [[R:%.*]] = call i9 @llvm.fshr.i9(i9 -1, i9 -1, i9 [[SHAMT:%.*]])
+; CHECK-NEXT: ret i9 [[R]]
+;
+ %r = call i9 @llvm.fshr.i9(i9 -1, i9 -1, i9 %shamt)
+ ret i9 %r
+}
+
declare double @llvm.fma.f64(double,double,double)
declare double @llvm.fmuladd.f64(double,double,double)
More information about the llvm-commits
mailing list