summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstSimplify/call.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/InstSimplify/call.ll')
-rw-r--r--llvm/test/Transforms/InstSimplify/call.ll40
1 files changed, 40 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/call.ll b/llvm/test/Transforms/InstSimplify/call.ll
index 3c054e3dfc0..4207a27fd36 100644
--- a/llvm/test/Transforms/InstSimplify/call.ll
+++ b/llvm/test/Transforms/InstSimplify/call.ll
@@ -628,3 +628,43 @@ define <2 x i8> @fshr_zero_shift_guard_splat(<2 x i8> %x, <2 x i8> %y, <2 x i8>
ret <2 x i8> %s
}
+; If first two operands of funnel shift are undef, the result is undef
+
+define i8 @fshl_ops_undef(i8 %shamt) {
+; CHECK-LABEL: @fshl_ops_undef(
+; CHECK-NEXT: [[R:%.*]] = call i8 @llvm.fshl.i8(i8 undef, i8 undef, i8 [[SHAMT:%.*]])
+; CHECK-NEXT: ret i8 [[R]]
+;
+ %r = call i8 @llvm.fshl.i8(i8 undef, i8 undef, i8 %shamt)
+ ret i8 %r
+}
+
+define i9 @fshr_ops_undef(i9 %shamt) {
+; CHECK-LABEL: @fshr_ops_undef(
+; CHECK-NEXT: [[R:%.*]] = call i9 @llvm.fshr.i9(i9 undef, i9 undef, i9 [[SHAMT:%.*]])
+; CHECK-NEXT: ret i9 [[R]]
+;
+ %r = call i9 @llvm.fshr.i9(i9 undef, i9 undef, i9 %shamt)
+ ret i9 %r
+}
+
+; If shift amount is undef, treat it as zero, returning operand 0 or 1
+
+define i8 @fshl_shift_undef(i8 %x, i8 %y) {
+; CHECK-LABEL: @fshl_shift_undef(
+; CHECK-NEXT: [[R:%.*]] = call i8 @llvm.fshl.i8(i8 [[X:%.*]], i8 [[Y:%.*]], i8 undef)
+; CHECK-NEXT: ret i8 [[R]]
+;
+ %r = call i8 @llvm.fshl.i8(i8 %x, i8 %y, i8 undef)
+ ret i8 %r
+}
+
+define i9 @fshr_shift_undef(i9 %x, i9 %y) {
+; CHECK-LABEL: @fshr_shift_undef(
+; CHECK-NEXT: [[R:%.*]] = call i9 @llvm.fshr.i9(i9 [[X:%.*]], i9 [[Y:%.*]], i9 undef)
+; CHECK-NEXT: ret i9 [[R]]
+;
+ %r = call i9 @llvm.fshr.i9(i9 %x, i9 %y, i9 undef)
+ ret i9 %r
+}
+
OpenPOWER on IntegriCloud