424 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 22; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-simplifylib %s | FileCheck %s3 4declare <2 x float> @_Z4fminDv2_ff(<2 x float>, float)5declare <2 x float> @_Z4fminDv2_fS_(<2 x float>, <2 x float>)6declare <3 x float> @_Z4fminDv3_ff(<3 x float>, float)7declare <3 x float> @_Z4fminDv3_fS_(<3 x float>, <3 x float>)8declare <4 x float> @_Z4fminDv4_ff(<4 x float>, float)9declare <4 x float> @_Z4fminDv4_fS_(<4 x float>, <4 x float>)10declare <8 x float> @_Z4fminDv8_ff(<8 x float>, float)11declare <8 x float> @_Z4fminDv8_fS_(<8 x float>, <8 x float>)12declare <16 x float> @_Z4fminDv16_ff(<16 x float>, float)13declare <16 x float> @_Z4fminDv16_fS_(<16 x float>, <16 x float>)14declare <2 x double> @_Z4fminDv2_dd(<2 x double>, double)15declare <2 x double> @_Z4fminDv2_dS_(<2 x double>, <2 x double>)16declare <3 x double> @_Z4fminDv3_dd(<3 x double>, double)17declare <3 x double> @_Z4fminDv3_dS_(<3 x double>, <3 x double>)18declare <4 x double> @_Z4fminDv4_dd(<4 x double>, double)19declare <4 x double> @_Z4fminDv4_dS_(<4 x double>, <4 x double>)20declare <8 x double> @_Z4fminDv8_dd(<8 x double>, double)21declare <8 x double> @_Z4fminDv8_dS_(<8 x double>, <8 x double>)22declare <16 x double> @_Z4fminDv16_dd(<16 x double>, double)23declare <16 x double> @_Z4fminDv16_dS_(<16 x double>, <16 x double>)24declare <2 x half> @_Z4fminDv2_DhDh(<2 x half>, half)25declare <2 x half> @_Z4fminDv2_DhS_(<2 x half>, <2 x half>)26declare <3 x half> @_Z4fminDv3_DhDh(<3 x half>, half)27declare <3 x half> @_Z4fminDv3_DhS_(<3 x half>, <3 x half>)28declare <4 x half> @_Z4fminDv4_DhDh(<4 x half>, half)29declare <4 x half> @_Z4fminDv4_DhS_(<4 x half>, <4 x half>)30declare <8 x half> @_Z4fminDv8_DhDh(<8 x half>, half)31declare <8 x half> @_Z4fminDv8_DhS_(<8 x half>, <8 x half>)32declare <16 x half> @_Z4fminDv16_DhDh(<16 x half>, half)33declare <16 x half> @_Z4fminDv16_DhS_(<16 x half>, <16 x half>)34 35define <2 x float> @test_fmin_v2f32_f32(<2 x float> %x, float %y) {36; CHECK-LABEL: define <2 x float> @test_fmin_v2f32_f3237; CHECK-SAME: (<2 x float> [[X:%.*]], float [[Y:%.*]]) {38; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <2 x float> poison, float [[Y]], i64 039; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <2 x float> [[DOTSPLATINSERT]], <2 x float> poison, <2 x i32> zeroinitializer40; CHECK-NEXT: [[MIN:%.*]] = tail call <2 x float> @llvm.minnum.v2f32(<2 x float> [[X]], <2 x float> [[DOTSPLAT]])41; CHECK-NEXT: ret <2 x float> [[MIN]]42;43 %min = tail call <2 x float> @_Z4fminDv2_ff(<2 x float> %x, float %y)44 ret <2 x float> %min45}46 47define <2 x float> @test_fmin_f32_v2f32(float %x, <2 x float> %y) {48; CHECK-LABEL: define <2 x float> @test_fmin_f32_v2f3249; CHECK-SAME: (float [[X:%.*]], <2 x float> [[Y:%.*]]) {50; CHECK-NEXT: [[INSERT:%.*]] = insertelement <2 x float> poison, float [[X]], i64 051; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x float> [[INSERT]], <2 x float> poison, <2 x i32> zeroinitializer52; CHECK-NEXT: [[MIN:%.*]] = tail call <2 x float> @llvm.minnum.v2f32(<2 x float> [[SHUFFLE]], <2 x float> [[Y]])53; CHECK-NEXT: ret <2 x float> [[MIN]]54;55 %insert = insertelement <2 x float> poison, float %x, i64 056 %shuffle = shufflevector <2 x float> %insert, <2 x float> poison, <2 x i32> zeroinitializer57 %min = tail call <2 x float> @_Z4fminDv2_fS_(<2 x float> %shuffle, <2 x float> %y)58 ret <2 x float> %min59}60 61define <3 x float> @test_fmin_v3f32_f32(<3 x float> %x, float %y) {62; CHECK-LABEL: define <3 x float> @test_fmin_v3f32_f3263; CHECK-SAME: (<3 x float> [[X:%.*]], float [[Y:%.*]]) {64; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <3 x float> poison, float [[Y]], i64 065; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <3 x float> [[DOTSPLATINSERT]], <3 x float> poison, <3 x i32> zeroinitializer66; CHECK-NEXT: [[MIN:%.*]] = tail call <3 x float> @llvm.minnum.v3f32(<3 x float> [[X]], <3 x float> [[DOTSPLAT]])67; CHECK-NEXT: ret <3 x float> [[MIN]]68;69 %min = tail call <3 x float> @_Z4fminDv3_ff(<3 x float> %x, float %y)70 ret <3 x float> %min71}72 73define <3 x float> @test_fmin_f32_v3f32(float %x, <3 x float> %y) {74; CHECK-LABEL: define <3 x float> @test_fmin_f32_v3f3275; CHECK-SAME: (float [[X:%.*]], <3 x float> [[Y:%.*]]) {76; CHECK-NEXT: [[INSERT:%.*]] = insertelement <3 x float> poison, float [[X]], i64 077; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <3 x float> [[INSERT]], <3 x float> poison, <3 x i32> zeroinitializer78; CHECK-NEXT: [[MIN:%.*]] = tail call <3 x float> @llvm.minnum.v3f32(<3 x float> [[SHUFFLE]], <3 x float> [[Y]])79; CHECK-NEXT: ret <3 x float> [[MIN]]80;81 %insert = insertelement <3 x float> poison, float %x, i64 082 %shuffle = shufflevector <3 x float> %insert, <3 x float> poison, <3 x i32> zeroinitializer83 %min = tail call <3 x float> @_Z4fminDv3_fS_(<3 x float> %shuffle, <3 x float> %y)84 ret <3 x float> %min85}86 87define <4 x float> @test_fmin_v4f32_f32(<4 x float> %x, float %y) {88; CHECK-LABEL: define <4 x float> @test_fmin_v4f32_f3289; CHECK-SAME: (<4 x float> [[X:%.*]], float [[Y:%.*]]) {90; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> poison, float [[Y]], i64 091; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> poison, <4 x i32> zeroinitializer92; CHECK-NEXT: [[MIN:%.*]] = tail call <4 x float> @llvm.minnum.v4f32(<4 x float> [[X]], <4 x float> [[DOTSPLAT]])93; CHECK-NEXT: ret <4 x float> [[MIN]]94;95 %min = tail call <4 x float> @_Z4fminDv4_ff(<4 x float> %x, float %y)96 ret <4 x float> %min97}98 99define <4 x float> @test_fmin_f32_v4f32(float %x, <4 x float> %y) {100; CHECK-LABEL: define <4 x float> @test_fmin_f32_v4f32101; CHECK-SAME: (float [[X:%.*]], <4 x float> [[Y:%.*]]) {102; CHECK-NEXT: [[INSERT:%.*]] = insertelement <4 x float> poison, float [[X]], i64 0103; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x float> [[INSERT]], <4 x float> poison, <4 x i32> zeroinitializer104; CHECK-NEXT: [[MIN:%.*]] = tail call <4 x float> @llvm.minnum.v4f32(<4 x float> [[SHUFFLE]], <4 x float> [[Y]])105; CHECK-NEXT: ret <4 x float> [[MIN]]106;107 %insert = insertelement <4 x float> poison, float %x, i64 0108 %shuffle = shufflevector <4 x float> %insert, <4 x float> poison, <4 x i32> zeroinitializer109 %min = tail call <4 x float> @_Z4fminDv4_fS_(<4 x float> %shuffle, <4 x float> %y)110 ret <4 x float> %min111}112 113define <8 x float> @test_fmin_v8f32_f32(<8 x float> %x, float %y) {114; CHECK-LABEL: define <8 x float> @test_fmin_v8f32_f32115; CHECK-SAME: (<8 x float> [[X:%.*]], float [[Y:%.*]]) {116; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x float> poison, float [[Y]], i64 0117; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x float> [[DOTSPLATINSERT]], <8 x float> poison, <8 x i32> zeroinitializer118; CHECK-NEXT: [[MIN:%.*]] = tail call <8 x float> @llvm.minnum.v8f32(<8 x float> [[X]], <8 x float> [[DOTSPLAT]])119; CHECK-NEXT: ret <8 x float> [[MIN]]120;121 %min = tail call <8 x float> @_Z4fminDv8_ff(<8 x float> %x, float %y)122 ret <8 x float> %min123}124 125define <8 x float> @test_fmin_f32_v8f32(float %x, <8 x float> %y) {126; CHECK-LABEL: define <8 x float> @test_fmin_f32_v8f32127; CHECK-SAME: (float [[X:%.*]], <8 x float> [[Y:%.*]]) {128; CHECK-NEXT: [[INSERT:%.*]] = insertelement <8 x float> poison, float [[X]], i64 0129; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <8 x float> [[INSERT]], <8 x float> poison, <8 x i32> zeroinitializer130; CHECK-NEXT: [[MIN:%.*]] = tail call <8 x float> @llvm.minnum.v8f32(<8 x float> [[SHUFFLE]], <8 x float> [[Y]])131; CHECK-NEXT: ret <8 x float> [[MIN]]132;133 %insert = insertelement <8 x float> poison, float %x, i64 0134 %shuffle = shufflevector <8 x float> %insert, <8 x float> poison, <8 x i32> zeroinitializer135 %min = tail call <8 x float> @_Z4fminDv8_fS_(<8 x float> %shuffle, <8 x float> %y)136 ret <8 x float> %min137}138 139define <16 x float> @test_fmin_v16f32_f32(<16 x float> %x, float %y) {140; CHECK-LABEL: define <16 x float> @test_fmin_v16f32_f32141; CHECK-SAME: (<16 x float> [[X:%.*]], float [[Y:%.*]]) {142; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x float> poison, float [[Y]], i64 0143; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x float> [[DOTSPLATINSERT]], <16 x float> poison, <16 x i32> zeroinitializer144; CHECK-NEXT: [[MIN:%.*]] = tail call <16 x float> @llvm.minnum.v16f32(<16 x float> [[X]], <16 x float> [[DOTSPLAT]])145; CHECK-NEXT: ret <16 x float> [[MIN]]146;147 %min = tail call <16 x float> @_Z4fminDv16_ff(<16 x float> %x, float %y)148 ret <16 x float> %min149}150 151define <16 x float> @test_fmin_f32_v16f32(float %x, <16 x float> %y) {152; CHECK-LABEL: define <16 x float> @test_fmin_f32_v16f32153; CHECK-SAME: (float [[X:%.*]], <16 x float> [[Y:%.*]]) {154; CHECK-NEXT: [[INSERT:%.*]] = insertelement <16 x float> poison, float [[X]], i64 0155; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <16 x float> [[INSERT]], <16 x float> poison, <16 x i32> zeroinitializer156; CHECK-NEXT: [[MIN:%.*]] = tail call <16 x float> @llvm.minnum.v16f32(<16 x float> [[SHUFFLE]], <16 x float> [[Y]])157; CHECK-NEXT: ret <16 x float> [[MIN]]158;159 %insert = insertelement <16 x float> poison, float %x, i64 0160 %shuffle = shufflevector <16 x float> %insert, <16 x float> poison, <16 x i32> zeroinitializer161 %min = tail call <16 x float> @_Z4fminDv16_fS_(<16 x float> %shuffle, <16 x float> %y)162 ret <16 x float> %min163}164 165define <2 x double> @test_fmin_v2f64_f64(<2 x double> %x, double %y) {166; CHECK-LABEL: define <2 x double> @test_fmin_v2f64_f64167; CHECK-SAME: (<2 x double> [[X:%.*]], double [[Y:%.*]]) {168; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <2 x double> poison, double [[Y]], i64 0169; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <2 x double> [[DOTSPLATINSERT]], <2 x double> poison, <2 x i32> zeroinitializer170; CHECK-NEXT: [[MIN:%.*]] = tail call <2 x double> @llvm.minnum.v2f64(<2 x double> [[X]], <2 x double> [[DOTSPLAT]])171; CHECK-NEXT: ret <2 x double> [[MIN]]172;173 %min = tail call <2 x double> @_Z4fminDv2_dd(<2 x double> %x, double %y)174 ret <2 x double> %min175}176 177define <2 x double> @test_fmin_f64_v2f64(double %x, <2 x double> %y) {178; CHECK-LABEL: define <2 x double> @test_fmin_f64_v2f64179; CHECK-SAME: (double [[X:%.*]], <2 x double> [[Y:%.*]]) {180; CHECK-NEXT: [[INSERT:%.*]] = insertelement <2 x double> poison, double [[X]], i64 0181; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x double> [[INSERT]], <2 x double> poison, <2 x i32> zeroinitializer182; CHECK-NEXT: [[MIN:%.*]] = tail call <2 x double> @llvm.minnum.v2f64(<2 x double> [[SHUFFLE]], <2 x double> [[Y]])183; CHECK-NEXT: ret <2 x double> [[MIN]]184;185 %insert = insertelement <2 x double> poison, double %x, i64 0186 %shuffle = shufflevector <2 x double> %insert, <2 x double> poison, <2 x i32> zeroinitializer187 %min = tail call <2 x double> @_Z4fminDv2_dS_(<2 x double> %shuffle, <2 x double> %y)188 ret <2 x double> %min189}190 191define <3 x double> @test_fmin_v3f64_f64(<3 x double> %x, double %y) {192; CHECK-LABEL: define <3 x double> @test_fmin_v3f64_f64193; CHECK-SAME: (<3 x double> [[X:%.*]], double [[Y:%.*]]) {194; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <3 x double> poison, double [[Y]], i64 0195; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <3 x double> [[DOTSPLATINSERT]], <3 x double> poison, <3 x i32> zeroinitializer196; CHECK-NEXT: [[MIN:%.*]] = tail call <3 x double> @llvm.minnum.v3f64(<3 x double> [[X]], <3 x double> [[DOTSPLAT]])197; CHECK-NEXT: ret <3 x double> [[MIN]]198;199 %min = tail call <3 x double> @_Z4fminDv3_dd(<3 x double> %x, double %y)200 ret <3 x double> %min201}202 203define <3 x double> @test_fmin_f64_v3f64(double %x, <3 x double> %y) {204; CHECK-LABEL: define <3 x double> @test_fmin_f64_v3f64205; CHECK-SAME: (double [[X:%.*]], <3 x double> [[Y:%.*]]) {206; CHECK-NEXT: [[INSERT:%.*]] = insertelement <3 x double> poison, double [[X]], i64 0207; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <3 x double> [[INSERT]], <3 x double> poison, <3 x i32> zeroinitializer208; CHECK-NEXT: [[MIN:%.*]] = tail call <3 x double> @llvm.minnum.v3f64(<3 x double> [[SHUFFLE]], <3 x double> [[Y]])209; CHECK-NEXT: ret <3 x double> [[MIN]]210;211 %insert = insertelement <3 x double> poison, double %x, i64 0212 %shuffle = shufflevector <3 x double> %insert, <3 x double> poison, <3 x i32> zeroinitializer213 %min = tail call <3 x double> @_Z4fminDv3_dS_(<3 x double> %shuffle, <3 x double> %y)214 ret <3 x double> %min215}216 217define <4 x double> @test_fmin_v4f64_f64(<4 x double> %x, double %y) {218; CHECK-LABEL: define <4 x double> @test_fmin_v4f64_f64219; CHECK-SAME: (<4 x double> [[X:%.*]], double [[Y:%.*]]) {220; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x double> poison, double [[Y]], i64 0221; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x double> [[DOTSPLATINSERT]], <4 x double> poison, <4 x i32> zeroinitializer222; CHECK-NEXT: [[MIN:%.*]] = tail call <4 x double> @llvm.minnum.v4f64(<4 x double> [[X]], <4 x double> [[DOTSPLAT]])223; CHECK-NEXT: ret <4 x double> [[MIN]]224;225 %min = tail call <4 x double> @_Z4fminDv4_dd(<4 x double> %x, double %y)226 ret <4 x double> %min227}228 229define <4 x double> @test_fmin_f64_v4f64(double %x, <4 x double> %y) {230; CHECK-LABEL: define <4 x double> @test_fmin_f64_v4f64231; CHECK-SAME: (double [[X:%.*]], <4 x double> [[Y:%.*]]) {232; CHECK-NEXT: [[INSERT:%.*]] = insertelement <4 x double> poison, double [[X]], i64 0233; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x double> [[INSERT]], <4 x double> poison, <4 x i32> zeroinitializer234; CHECK-NEXT: [[MIN:%.*]] = tail call <4 x double> @llvm.minnum.v4f64(<4 x double> [[SHUFFLE]], <4 x double> [[Y]])235; CHECK-NEXT: ret <4 x double> [[MIN]]236;237 %insert = insertelement <4 x double> poison, double %x, i64 0238 %shuffle = shufflevector <4 x double> %insert, <4 x double> poison, <4 x i32> zeroinitializer239 %min = tail call <4 x double> @_Z4fminDv4_dS_(<4 x double> %shuffle, <4 x double> %y)240 ret <4 x double> %min241}242 243define <8 x double> @test_fmin_v8f64_f64(<8 x double> %x, double %y) {244; CHECK-LABEL: define <8 x double> @test_fmin_v8f64_f64245; CHECK-SAME: (<8 x double> [[X:%.*]], double [[Y:%.*]]) {246; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x double> poison, double [[Y]], i64 0247; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x double> [[DOTSPLATINSERT]], <8 x double> poison, <8 x i32> zeroinitializer248; CHECK-NEXT: [[MIN:%.*]] = tail call <8 x double> @llvm.minnum.v8f64(<8 x double> [[X]], <8 x double> [[DOTSPLAT]])249; CHECK-NEXT: ret <8 x double> [[MIN]]250;251 %min = tail call <8 x double> @_Z4fminDv8_dd(<8 x double> %x, double %y)252 ret <8 x double> %min253}254 255define <8 x double> @test_fmin_f64_v8f64(double %x, <8 x double> %y) {256; CHECK-LABEL: define <8 x double> @test_fmin_f64_v8f64257; CHECK-SAME: (double [[X:%.*]], <8 x double> [[Y:%.*]]) {258; CHECK-NEXT: [[INSERT:%.*]] = insertelement <8 x double> poison, double [[X]], i64 0259; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <8 x double> [[INSERT]], <8 x double> poison, <8 x i32> zeroinitializer260; CHECK-NEXT: [[MIN:%.*]] = tail call <8 x double> @llvm.minnum.v8f64(<8 x double> [[SHUFFLE]], <8 x double> [[Y]])261; CHECK-NEXT: ret <8 x double> [[MIN]]262;263 %insert = insertelement <8 x double> poison, double %x, i64 0264 %shuffle = shufflevector <8 x double> %insert, <8 x double> poison, <8 x i32> zeroinitializer265 %min = tail call <8 x double> @_Z4fminDv8_dS_(<8 x double> %shuffle, <8 x double> %y)266 ret <8 x double> %min267}268 269define <16 x double> @test_fmin_v16f64_f64(<16 x double> %x, double %y) {270; CHECK-LABEL: define <16 x double> @test_fmin_v16f64_f64271; CHECK-SAME: (<16 x double> [[X:%.*]], double [[Y:%.*]]) {272; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x double> poison, double [[Y]], i64 0273; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x double> [[DOTSPLATINSERT]], <16 x double> poison, <16 x i32> zeroinitializer274; CHECK-NEXT: [[MIN:%.*]] = tail call <16 x double> @llvm.minnum.v16f64(<16 x double> [[X]], <16 x double> [[DOTSPLAT]])275; CHECK-NEXT: ret <16 x double> [[MIN]]276;277 %min = tail call <16 x double> @_Z4fminDv16_dd(<16 x double> %x, double %y)278 ret <16 x double> %min279}280 281define <16 x double> @test_fmin_f64_v16f64(double %x, <16 x double> %y) {282; CHECK-LABEL: define <16 x double> @test_fmin_f64_v16f64283; CHECK-SAME: (double [[X:%.*]], <16 x double> [[Y:%.*]]) {284; CHECK-NEXT: [[INSERT:%.*]] = insertelement <16 x double> poison, double [[X]], i64 0285; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <16 x double> [[INSERT]], <16 x double> poison, <16 x i32> zeroinitializer286; CHECK-NEXT: [[MIN:%.*]] = tail call <16 x double> @llvm.minnum.v16f64(<16 x double> [[SHUFFLE]], <16 x double> [[Y]])287; CHECK-NEXT: ret <16 x double> [[MIN]]288;289 %insert = insertelement <16 x double> poison, double %x, i64 0290 %shuffle = shufflevector <16 x double> %insert, <16 x double> poison, <16 x i32> zeroinitializer291 %min = tail call <16 x double> @_Z4fminDv16_dS_(<16 x double> %shuffle, <16 x double> %y)292 ret <16 x double> %min293}294 295define <2 x half> @test_fmin_v2f16_f16(<2 x half> %x, half %y) {296; CHECK-LABEL: define <2 x half> @test_fmin_v2f16_f16297; CHECK-SAME: (<2 x half> [[X:%.*]], half [[Y:%.*]]) {298; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <2 x half> poison, half [[Y]], i64 0299; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <2 x half> [[DOTSPLATINSERT]], <2 x half> poison, <2 x i32> zeroinitializer300; CHECK-NEXT: [[MIN:%.*]] = tail call <2 x half> @llvm.minnum.v2f16(<2 x half> [[X]], <2 x half> [[DOTSPLAT]])301; CHECK-NEXT: ret <2 x half> [[MIN]]302;303 %min = tail call <2 x half> @_Z4fminDv2_DhDh(<2 x half> %x, half %y)304 ret <2 x half> %min305}306 307define <2 x half> @test_fmin_f16_v2f16(half %x, <2 x half> %y) {308; CHECK-LABEL: define <2 x half> @test_fmin_f16_v2f16309; CHECK-SAME: (half [[X:%.*]], <2 x half> [[Y:%.*]]) {310; CHECK-NEXT: [[INSERT:%.*]] = insertelement <2 x half> poison, half [[X]], i64 0311; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x half> [[INSERT]], <2 x half> poison, <2 x i32> zeroinitializer312; CHECK-NEXT: [[MIN:%.*]] = tail call <2 x half> @llvm.minnum.v2f16(<2 x half> [[SHUFFLE]], <2 x half> [[Y]])313; CHECK-NEXT: ret <2 x half> [[MIN]]314;315 %insert = insertelement <2 x half> poison, half %x, i64 0316 %shuffle = shufflevector <2 x half> %insert, <2 x half> poison, <2 x i32> zeroinitializer317 %min = tail call <2 x half> @_Z4fminDv2_DhS_(<2 x half> %shuffle, <2 x half> %y)318 ret <2 x half> %min319}320 321define <3 x half> @test_fmin_v3f16_f16(<3 x half> %x, half %y) {322; CHECK-LABEL: define <3 x half> @test_fmin_v3f16_f16323; CHECK-SAME: (<3 x half> [[X:%.*]], half [[Y:%.*]]) {324; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <3 x half> poison, half [[Y]], i64 0325; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <3 x half> [[DOTSPLATINSERT]], <3 x half> poison, <3 x i32> zeroinitializer326; CHECK-NEXT: [[MIN:%.*]] = tail call <3 x half> @llvm.minnum.v3f16(<3 x half> [[X]], <3 x half> [[DOTSPLAT]])327; CHECK-NEXT: ret <3 x half> [[MIN]]328;329 %min = tail call <3 x half> @_Z4fminDv3_DhDh(<3 x half> %x, half %y)330 ret <3 x half> %min331}332 333define <3 x half> @test_fmin_f16_v3f16(half %x, <3 x half> %y) {334; CHECK-LABEL: define <3 x half> @test_fmin_f16_v3f16335; CHECK-SAME: (half [[X:%.*]], <3 x half> [[Y:%.*]]) {336; CHECK-NEXT: [[INSERT:%.*]] = insertelement <3 x half> poison, half [[X]], i64 0337; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <3 x half> [[INSERT]], <3 x half> poison, <3 x i32> zeroinitializer338; CHECK-NEXT: [[MIN:%.*]] = tail call <3 x half> @llvm.minnum.v3f16(<3 x half> [[SHUFFLE]], <3 x half> [[Y]])339; CHECK-NEXT: ret <3 x half> [[MIN]]340;341 %insert = insertelement <3 x half> poison, half %x, i64 0342 %shuffle = shufflevector <3 x half> %insert, <3 x half> poison, <3 x i32> zeroinitializer343 %min = tail call <3 x half> @_Z4fminDv3_DhS_(<3 x half> %shuffle, <3 x half> %y)344 ret <3 x half> %min345}346 347define <4 x half> @test_fmin_v4f16_f16(<4 x half> %x, half %y) {348; CHECK-LABEL: define <4 x half> @test_fmin_v4f16_f16349; CHECK-SAME: (<4 x half> [[X:%.*]], half [[Y:%.*]]) {350; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x half> poison, half [[Y]], i64 0351; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x half> [[DOTSPLATINSERT]], <4 x half> poison, <4 x i32> zeroinitializer352; CHECK-NEXT: [[MIN:%.*]] = tail call <4 x half> @llvm.minnum.v4f16(<4 x half> [[X]], <4 x half> [[DOTSPLAT]])353; CHECK-NEXT: ret <4 x half> [[MIN]]354;355 %min = tail call <4 x half> @_Z4fminDv4_DhDh(<4 x half> %x, half %y)356 ret <4 x half> %min357}358 359define <4 x half> @test_fmin_f16_v4f16(half %x, <4 x half> %y) {360; CHECK-LABEL: define <4 x half> @test_fmin_f16_v4f16361; CHECK-SAME: (half [[X:%.*]], <4 x half> [[Y:%.*]]) {362; CHECK-NEXT: [[INSERT:%.*]] = insertelement <4 x half> poison, half [[X]], i64 0363; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <4 x half> [[INSERT]], <4 x half> poison, <4 x i32> zeroinitializer364; CHECK-NEXT: [[MIN:%.*]] = tail call <4 x half> @llvm.minnum.v4f16(<4 x half> [[SHUFFLE]], <4 x half> [[Y]])365; CHECK-NEXT: ret <4 x half> [[MIN]]366;367 %insert = insertelement <4 x half> poison, half %x, i64 0368 %shuffle = shufflevector <4 x half> %insert, <4 x half> poison, <4 x i32> zeroinitializer369 %min = tail call <4 x half> @_Z4fminDv4_DhS_(<4 x half> %shuffle, <4 x half> %y)370 ret <4 x half> %min371}372 373define <8 x half> @test_fmin_v8f16_f16(<8 x half> %x, half %y) {374; CHECK-LABEL: define <8 x half> @test_fmin_v8f16_f16375; CHECK-SAME: (<8 x half> [[X:%.*]], half [[Y:%.*]]) {376; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x half> poison, half [[Y]], i64 0377; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x half> [[DOTSPLATINSERT]], <8 x half> poison, <8 x i32> zeroinitializer378; CHECK-NEXT: [[MIN:%.*]] = tail call <8 x half> @llvm.minnum.v8f16(<8 x half> [[X]], <8 x half> [[DOTSPLAT]])379; CHECK-NEXT: ret <8 x half> [[MIN]]380;381 %min = tail call <8 x half> @_Z4fminDv8_DhDh(<8 x half> %x, half %y)382 ret <8 x half> %min383}384 385define <8 x half> @test_fmin_f16_v8f16(half %x, <8 x half> %y) {386; CHECK-LABEL: define <8 x half> @test_fmin_f16_v8f16387; CHECK-SAME: (half [[X:%.*]], <8 x half> [[Y:%.*]]) {388; CHECK-NEXT: [[INSERT:%.*]] = insertelement <8 x half> poison, half [[X]], i64 0389; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <8 x half> [[INSERT]], <8 x half> poison, <8 x i32> zeroinitializer390; CHECK-NEXT: [[MIN:%.*]] = tail call <8 x half> @llvm.minnum.v8f16(<8 x half> [[SHUFFLE]], <8 x half> [[Y]])391; CHECK-NEXT: ret <8 x half> [[MIN]]392;393 %insert = insertelement <8 x half> poison, half %x, i64 0394 %shuffle = shufflevector <8 x half> %insert, <8 x half> poison, <8 x i32> zeroinitializer395 %min = tail call <8 x half> @_Z4fminDv8_DhS_(<8 x half> %shuffle, <8 x half> %y)396 ret <8 x half> %min397}398 399define <16 x half> @test_fmin_v16f16_f16(<16 x half> %x, half %y) {400; CHECK-LABEL: define <16 x half> @test_fmin_v16f16_f16401; CHECK-SAME: (<16 x half> [[X:%.*]], half [[Y:%.*]]) {402; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x half> poison, half [[Y]], i64 0403; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x half> [[DOTSPLATINSERT]], <16 x half> poison, <16 x i32> zeroinitializer404; CHECK-NEXT: [[MIN:%.*]] = tail call <16 x half> @llvm.minnum.v16f16(<16 x half> [[X]], <16 x half> [[DOTSPLAT]])405; CHECK-NEXT: ret <16 x half> [[MIN]]406;407 %min = tail call <16 x half> @_Z4fminDv16_DhDh(<16 x half> %x, half %y)408 ret <16 x half> %min409}410 411define <16 x half> @test_fmin_f16_v16f16(half %x, <16 x half> %y) {412; CHECK-LABEL: define <16 x half> @test_fmin_f16_v16f16413; CHECK-SAME: (half [[X:%.*]], <16 x half> [[Y:%.*]]) {414; CHECK-NEXT: [[INSERT:%.*]] = insertelement <16 x half> poison, half [[X]], i64 0415; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <16 x half> [[INSERT]], <16 x half> poison, <16 x i32> zeroinitializer416; CHECK-NEXT: [[MIN:%.*]] = tail call <16 x half> @llvm.minnum.v16f16(<16 x half> [[SHUFFLE]], <16 x half> [[Y]])417; CHECK-NEXT: ret <16 x half> [[MIN]]418;419 %insert = insertelement <16 x half> poison, half %x, i64 0420 %shuffle = shufflevector <16 x half> %insert, <16 x half> poison, <16 x i32> zeroinitializer421 %min = tail call <16 x half> @_Z4fminDv16_DhS_(<16 x half> %shuffle, <16 x half> %y)422 ret <16 x half> %min423}424