llvm.org GIT mirror llvm / acc323b
[InstSimplify] add tests for funnel shift with undef operands; NFC These are part of D54666, so adding them here before the patch to show the baseline (currently unoptimized) results. Patch by: @nikic (Nikita Popov) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347331 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjay Patel 10 months ago
1 changed file(s) with 40 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
627627 ret <2 x i8> %s
628628 }
629629
630 ; If first two operands of funnel shift are undef, the result is undef
631
632 define i8 @fshl_ops_undef(i8 %shamt) {
633 ; CHECK-LABEL: @fshl_ops_undef(
634 ; CHECK-NEXT: [[R:%.*]] = call i8 @llvm.fshl.i8(i8 undef, i8 undef, i8 [[SHAMT:%.*]])
635 ; CHECK-NEXT: ret i8 [[R]]
636 ;
637 %r = call i8 @llvm.fshl.i8(i8 undef, i8 undef, i8 %shamt)
638 ret i8 %r
639 }
640
641 define i9 @fshr_ops_undef(i9 %shamt) {
642 ; CHECK-LABEL: @fshr_ops_undef(
643 ; CHECK-NEXT: [[R:%.*]] = call i9 @llvm.fshr.i9(i9 undef, i9 undef, i9 [[SHAMT:%.*]])
644 ; CHECK-NEXT: ret i9 [[R]]
645 ;
646 %r = call i9 @llvm.fshr.i9(i9 undef, i9 undef, i9 %shamt)
647 ret i9 %r
648 }
649
650 ; If shift amount is undef, treat it as zero, returning operand 0 or 1
651
652 define i8 @fshl_shift_undef(i8 %x, i8 %y) {
653 ; CHECK-LABEL: @fshl_shift_undef(
654 ; CHECK-NEXT: [[R:%.*]] = call i8 @llvm.fshl.i8(i8 [[X:%.*]], i8 [[Y:%.*]], i8 undef)
655 ; CHECK-NEXT: ret i8 [[R]]
656 ;
657 %r = call i8 @llvm.fshl.i8(i8 %x, i8 %y, i8 undef)
658 ret i8 %r
659 }
660
661 define i9 @fshr_shift_undef(i9 %x, i9 %y) {
662 ; CHECK-LABEL: @fshr_shift_undef(
663 ; CHECK-NEXT: [[R:%.*]] = call i9 @llvm.fshr.i9(i9 [[X:%.*]], i9 [[Y:%.*]], i9 undef)
664 ; CHECK-NEXT: ret i9 [[R]]
665 ;
666 %r = call i9 @llvm.fshr.i9(i9 %x, i9 %y, i9 undef)
667 ret i9 %r
668 }
669