From a70fdf863573e0c4220c4ca9e82f9119b6dcf333 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 21 Nov 2018 20:34:11 +0000 Subject: [PATCH] [InstCombine] Add tests for funnel shift with zero operand; NFC These are additional baseline tests for D54778. llvm-svn: 347414 --- llvm/test/Transforms/InstCombine/fsh.ll | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/llvm/test/Transforms/InstCombine/fsh.ll b/llvm/test/Transforms/InstCombine/fsh.ll index 3526aab68a34..0d85613d3482 100644 --- a/llvm/test/Transforms/InstCombine/fsh.ll +++ b/llvm/test/Transforms/InstCombine/fsh.ll @@ -152,6 +152,15 @@ define i32 @fshl_op0_undef(i32 %x) { ret i32 %r } +define i32 @fshl_op0_zero(i32 %x) { +; CHECK-LABEL: @fshl_op0_zero( +; CHECK-NEXT: [[R:%.*]] = call i32 @llvm.fshl.i32(i32 0, i32 [[X:%.*]], i32 7) +; CHECK-NEXT: ret i32 [[R]] +; + %r = call i32 @llvm.fshl.i32(i32 0, i32 %x, i32 7) + ret i32 %r +} + define i33 @fshr_op0_undef(i33 %x) { ; CHECK-LABEL: @fshr_op0_undef( ; CHECK-NEXT: [[R:%.*]] = call i33 @llvm.fshr.i33(i33 undef, i33 [[X:%.*]], i33 7) @@ -161,6 +170,15 @@ define i33 @fshr_op0_undef(i33 %x) { ret i33 %r } +define i33 @fshr_op0_zero(i33 %x) { +; CHECK-LABEL: @fshr_op0_zero( +; CHECK-NEXT: [[R:%.*]] = call i33 @llvm.fshr.i33(i33 0, i33 [[X:%.*]], i33 7) +; CHECK-NEXT: ret i33 [[R]] +; + %r = call i33 @llvm.fshr.i33(i33 0, i33 %x, i33 7) + ret i33 %r +} + define i32 @fshl_op1_undef(i32 %x) { ; CHECK-LABEL: @fshl_op1_undef( ; CHECK-NEXT: [[R:%.*]] = call i32 @llvm.fshl.i32(i32 [[X:%.*]], i32 undef, i32 7) @@ -170,6 +188,15 @@ define i32 @fshl_op1_undef(i32 %x) { ret i32 %r } +define i32 @fshl_op1_zero(i32 %x) { +; CHECK-LABEL: @fshl_op1_zero( +; CHECK-NEXT: [[R:%.*]] = call i32 @llvm.fshl.i32(i32 [[X:%.*]], i32 0, i32 7) +; CHECK-NEXT: ret i32 [[R]] +; + %r = call i32 @llvm.fshl.i32(i32 %x, i32 0, i32 7) + ret i32 %r +} + define i33 @fshr_op1_undef(i33 %x) { ; CHECK-LABEL: @fshr_op1_undef( ; CHECK-NEXT: [[R:%.*]] = call i33 @llvm.fshr.i33(i33 [[X:%.*]], i33 undef, i33 7) @@ -179,6 +206,15 @@ define i33 @fshr_op1_undef(i33 %x) { ret i33 %r } +define i33 @fshr_op1_zero(i33 %x) { +; CHECK-LABEL: @fshr_op1_zero( +; CHECK-NEXT: [[R:%.*]] = call i33 @llvm.fshr.i33(i33 [[X:%.*]], i33 0, i33 7) +; CHECK-NEXT: ret i33 [[R]] +; + %r = call i33 @llvm.fshr.i33(i33 %x, i33 0, i33 7) + ret i33 %r +} + ; Only demand bits from one of the operands. define i32 @fshl_only_op0_demanded(i32 %x, i32 %y) {