1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -instcombine < %s | FileCheck %s
4 define i35 @smax(i35 %x) {
6 ; CHECK-NEXT: [[R:%.*]] = call i35 @llvm.smax.i35(i35 [[X:%.*]], i35 42)
7 ; CHECK-NEXT: ret i35 [[R]]
9 %r = call i35 @llvm.smax.i35(i35 42, i35 %x)
13 define i5 @smin(i5 %x) {
15 ; CHECK-NEXT: [[R:%.*]] = call i5 @llvm.smin.i5(i5 [[X:%.*]], i5 10)
16 ; CHECK-NEXT: ret i5 [[R]]
18 %r = call i5 @llvm.smin.i5(i5 42, i5 %x)
22 define <2 x i35> @umax(<2 x i35> %x) {
24 ; CHECK-NEXT: [[R:%.*]] = call <2 x i35> @llvm.umax.v2i35(<2 x i35> [[X:%.*]], <2 x i35> <i35 42, i35 43>)
25 ; CHECK-NEXT: ret <2 x i35> [[R]]
27 %r = call <2 x i35> @llvm.umax.v2i35(<2 x i35> <i35 42, i35 43>, <2 x i35> %x)
31 define <3 x i35> @umin(<3 x i35> %x) {
33 ; CHECK-NEXT: [[R:%.*]] = call <3 x i35> @llvm.umin.v3i35(<3 x i35> [[X:%.*]], <3 x i35> <i35 undef, i35 42, i35 43>)
34 ; CHECK-NEXT: ret <3 x i35> [[R]]
36 %r = call <3 x i35> @llvm.umin.v3i35(<3 x i35> <i35 undef, i35 42, i35 43>, <3 x i35> %x)
40 define i35 @smul_fix(i35 %x) {
41 ; CHECK-LABEL: @smul_fix(
42 ; CHECK-NEXT: [[R:%.*]] = call i35 @llvm.smul.fix.i35(i35 [[X:%.*]], i35 42, i32 2)
43 ; CHECK-NEXT: ret i35 [[R]]
45 %r = call i35 @llvm.smul.fix.i35(i35 42, i35 %x, i32 2)
49 define i5 @umul_fix(i5 %x) {
50 ; CHECK-LABEL: @umul_fix(
51 ; CHECK-NEXT: [[R:%.*]] = call i5 @llvm.umul.fix.i5(i5 [[X:%.*]], i5 10, i32 3)
52 ; CHECK-NEXT: ret i5 [[R]]
54 %r = call i5 @llvm.umul.fix.i5(i5 42, i5 %x, i32 3)
58 define <2 x i35> @smul_fix_sat(<2 x i35> %x) {
59 ; CHECK-LABEL: @smul_fix_sat(
60 ; CHECK-NEXT: [[R:%.*]] = call <2 x i35> @llvm.smul.fix.sat.v2i35(<2 x i35> [[X:%.*]], <2 x i35> <i35 42, i35 43>, i32 4)
61 ; CHECK-NEXT: ret <2 x i35> [[R]]
63 %r = call <2 x i35> @llvm.smul.fix.sat.v2i35(<2 x i35> <i35 42, i35 43>, <2 x i35> %x, i32 4)
67 define <3 x i35> @umul_fix_sat(<3 x i35> %x) {
68 ; CHECK-LABEL: @umul_fix_sat(
69 ; CHECK-NEXT: [[R:%.*]] = call <3 x i35> @llvm.umul.fix.sat.v3i35(<3 x i35> [[X:%.*]], <3 x i35> <i35 undef, i35 42, i35 43>, i32 5)
70 ; CHECK-NEXT: ret <3 x i35> [[R]]
72 %r = call <3 x i35> @llvm.umul.fix.sat.v3i35(<3 x i35> <i35 undef, i35 42, i35 43>, <3 x i35> %x, i32 5)
76 declare i35 @llvm.smax.i35(i35, i35)
77 declare i5 @llvm.smin.i5(i5, i5)
78 declare <2 x i35> @llvm.umax.v2i35(<2 x i35>, <2 x i35>)
79 declare <3 x i35> @llvm.umin.v3i35(<3 x i35>, <3 x i35>)
80 declare i35 @llvm.smul.fix.i35(i35, i35, i32)
81 declare i5 @llvm.umul.fix.i5(i5, i5, i32)
82 declare <2 x i35> @llvm.smul.fix.sat.v2i35(<2 x i35>, <2 x i35>, i32)
83 declare <3 x i35> @llvm.umul.fix.sat.v3i35(<3 x i35>, <3 x i35>, i32)