1500 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals all --version 42; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-simplifylib,instcombine -amdgpu-prelink %s | FileCheck %s3 4declare float @_Z5rootnfi(float, i32)5declare <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float>, <2 x i32>)6declare <3 x float> @_Z5rootnDv3_fDv3_i(<3 x float>, <3 x i32>)7declare <4 x float> @_Z5rootnDv4_fDv4_i(<4 x float>, <4 x i32>)8declare <8 x float> @_Z5rootnDv8_fDv8_i(<8 x float>, <8 x i32>)9declare <16 x float> @_Z5rootnDv16_fDv16_i(<16 x float>, <16 x i32>)10declare double @_Z5rootndi(double, i32)11declare <2 x double> @_Z5rootnDv2_dDv2_i(<2 x double>, <2 x i32>)12declare <3 x double> @_Z5rootnDv3_dDv3_i(<3 x double>, <3 x i32>)13declare <4 x double> @_Z5rootnDv4_dDv4_i(<4 x double>, <4 x i32>)14declare <8 x double> @_Z5rootnDv8_dDv8_i(<8 x double>, <8 x i32>)15declare <16 x double> @_Z5rootnDv16_dDv16_i(<16 x double>, <16 x i32>)16declare half @_Z5rootnDhi(half, i32)17declare <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half>, <2 x i32>)18declare <3 x half> @_Z5rootnDv3_DhDv3_i(<3 x half>, <3 x i32>)19declare <4 x half> @_Z5rootnDv4_DhDv4_i(<4 x half>, <4 x i32>)20declare <8 x half> @_Z5rootnDv8_DhDv8_i(<8 x half>, <8 x i32>)21declare <16 x half> @_Z5rootnDv16_DhDv16_i(<16 x half>, <16 x i32>)22 23define float @test_rootn_f32(float %x, i32 %y) {24; CHECK-LABEL: define float @test_rootn_f32(25; CHECK-SAME: float [[X:%.*]], i32 [[Y:%.*]]) {26; CHECK-NEXT: entry:27; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 [[Y]])28; CHECK-NEXT: ret float [[CALL]]29;30entry:31 %call = tail call float @_Z5rootnfi(float %x, i32 %y)32 ret float %call33}34 35define float @test_rootn_f32_flags(float %x, i32 %y) {36; CHECK-LABEL: define float @test_rootn_f32_flags(37; CHECK-SAME: float [[X:%.*]], i32 [[Y:%.*]]) {38; CHECK-NEXT: entry:39; CHECK-NEXT: [[CALL:%.*]] = tail call nnan nsz float @_Z5rootnfi(float [[X]], i32 [[Y]])40; CHECK-NEXT: ret float [[CALL]]41;42entry:43 %call = tail call nnan nsz float @_Z5rootnfi(float %x, i32 %y)44 ret float %call45}46 47define <2 x float> @test_rootn_v2f32(<2 x float> %x, <2 x i32> %y) {48; CHECK-LABEL: define <2 x float> @test_rootn_v2f32(49; CHECK-SAME: <2 x float> [[X:%.*]], <2 x i32> [[Y:%.*]]) {50; CHECK-NEXT: entry:51; CHECK-NEXT: [[CALL:%.*]] = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> [[X]], <2 x i32> [[Y]])52; CHECK-NEXT: ret <2 x float> [[CALL]]53;54entry:55 %call = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> %y)56 ret <2 x float> %call57}58 59define <3 x float> @test_rootn_v3f32(<3 x float> %x, <3 x i32> %y) {60; CHECK-LABEL: define <3 x float> @test_rootn_v3f32(61; CHECK-SAME: <3 x float> [[X:%.*]], <3 x i32> [[Y:%.*]]) {62; CHECK-NEXT: entry:63; CHECK-NEXT: [[CALL:%.*]] = tail call <3 x float> @_Z5rootnDv3_fDv3_i(<3 x float> [[X]], <3 x i32> [[Y]])64; CHECK-NEXT: ret <3 x float> [[CALL]]65;66entry:67 %call = tail call <3 x float> @_Z5rootnDv3_fDv3_i(<3 x float> %x, <3 x i32> %y)68 ret <3 x float> %call69}70 71define <4 x float> @test_rootn_v4f32(<4 x float> %x, <4 x i32> %y) {72; CHECK-LABEL: define <4 x float> @test_rootn_v4f32(73; CHECK-SAME: <4 x float> [[X:%.*]], <4 x i32> [[Y:%.*]]) {74; CHECK-NEXT: entry:75; CHECK-NEXT: [[CALL:%.*]] = tail call <4 x float> @_Z5rootnDv4_fDv4_i(<4 x float> [[X]], <4 x i32> [[Y]])76; CHECK-NEXT: ret <4 x float> [[CALL]]77;78entry:79 %call = tail call <4 x float> @_Z5rootnDv4_fDv4_i(<4 x float> %x, <4 x i32> %y)80 ret <4 x float> %call81}82 83define <8 x float> @test_rootn_v8f32(<8 x float> %x, <8 x i32> %y) {84; CHECK-LABEL: define <8 x float> @test_rootn_v8f32(85; CHECK-SAME: <8 x float> [[X:%.*]], <8 x i32> [[Y:%.*]]) {86; CHECK-NEXT: entry:87; CHECK-NEXT: [[CALL:%.*]] = tail call <8 x float> @_Z5rootnDv8_fDv8_i(<8 x float> [[X]], <8 x i32> [[Y]])88; CHECK-NEXT: ret <8 x float> [[CALL]]89;90entry:91 %call = tail call <8 x float> @_Z5rootnDv8_fDv8_i(<8 x float> %x, <8 x i32> %y)92 ret <8 x float> %call93}94 95define <16 x float> @test_rootn_v16f32(<16 x float> %x, <16 x i32> %y) {96; CHECK-LABEL: define <16 x float> @test_rootn_v16f32(97; CHECK-SAME: <16 x float> [[X:%.*]], <16 x i32> [[Y:%.*]]) {98; CHECK-NEXT: entry:99; CHECK-NEXT: [[CALL:%.*]] = tail call <16 x float> @_Z5rootnDv16_fDv16_i(<16 x float> [[X]], <16 x i32> [[Y]])100; CHECK-NEXT: ret <16 x float> [[CALL]]101;102entry:103 %call = tail call <16 x float> @_Z5rootnDv16_fDv16_i(<16 x float> %x, <16 x i32> %y)104 ret <16 x float> %call105}106 107define double @test_rootn_f64(double %x, i32 %y) {108; CHECK-LABEL: define double @test_rootn_f64(109; CHECK-SAME: double [[X:%.*]], i32 [[Y:%.*]]) {110; CHECK-NEXT: entry:111; CHECK-NEXT: [[CALL:%.*]] = tail call double @_Z5rootndi(double [[X]], i32 [[Y]])112; CHECK-NEXT: ret double [[CALL]]113;114entry:115 %call = tail call double @_Z5rootndi(double %x, i32 %y)116 ret double %call117}118 119define <2 x double> @test_rootn_v2f64(<2 x double> %x, <2 x i32> %y) {120; CHECK-LABEL: define <2 x double> @test_rootn_v2f64(121; CHECK-SAME: <2 x double> [[X:%.*]], <2 x i32> [[Y:%.*]]) {122; CHECK-NEXT: entry:123; CHECK-NEXT: [[CALL:%.*]] = tail call <2 x double> @_Z5rootnDv2_dDv2_i(<2 x double> [[X]], <2 x i32> [[Y]])124; CHECK-NEXT: ret <2 x double> [[CALL]]125;126entry:127 %call = tail call <2 x double> @_Z5rootnDv2_dDv2_i(<2 x double> %x, <2 x i32> %y)128 ret <2 x double> %call129}130 131define <3 x double> @test_rootn_v3f64(<3 x double> %x, <3 x i32> %y) {132; CHECK-LABEL: define <3 x double> @test_rootn_v3f64(133; CHECK-SAME: <3 x double> [[X:%.*]], <3 x i32> [[Y:%.*]]) {134; CHECK-NEXT: entry:135; CHECK-NEXT: [[CALL:%.*]] = tail call <3 x double> @_Z5rootnDv3_dDv3_i(<3 x double> [[X]], <3 x i32> [[Y]])136; CHECK-NEXT: ret <3 x double> [[CALL]]137;138entry:139 %call = tail call <3 x double> @_Z5rootnDv3_dDv3_i(<3 x double> %x, <3 x i32> %y)140 ret <3 x double> %call141}142 143define <4 x double> @test_rootn_v4f64(<4 x double> %x, <4 x i32> %y) {144; CHECK-LABEL: define <4 x double> @test_rootn_v4f64(145; CHECK-SAME: <4 x double> [[X:%.*]], <4 x i32> [[Y:%.*]]) {146; CHECK-NEXT: entry:147; CHECK-NEXT: [[CALL:%.*]] = tail call <4 x double> @_Z5rootnDv4_dDv4_i(<4 x double> [[X]], <4 x i32> [[Y]])148; CHECK-NEXT: ret <4 x double> [[CALL]]149;150entry:151 %call = tail call <4 x double> @_Z5rootnDv4_dDv4_i(<4 x double> %x, <4 x i32> %y)152 ret <4 x double> %call153}154 155define <8 x double> @test_rootn_v8f64(<8 x double> %x, <8 x i32> %y) {156; CHECK-LABEL: define <8 x double> @test_rootn_v8f64(157; CHECK-SAME: <8 x double> [[X:%.*]], <8 x i32> [[Y:%.*]]) {158; CHECK-NEXT: entry:159; CHECK-NEXT: [[CALL:%.*]] = tail call <8 x double> @_Z5rootnDv8_dDv8_i(<8 x double> [[X]], <8 x i32> [[Y]])160; CHECK-NEXT: ret <8 x double> [[CALL]]161;162entry:163 %call = tail call <8 x double> @_Z5rootnDv8_dDv8_i(<8 x double> %x, <8 x i32> %y)164 ret <8 x double> %call165}166 167define <16 x double> @test_rootn_v16f64(<16 x double> %x, <16 x i32> %y) {168; CHECK-LABEL: define <16 x double> @test_rootn_v16f64(169; CHECK-SAME: <16 x double> [[X:%.*]], <16 x i32> [[Y:%.*]]) {170; CHECK-NEXT: entry:171; CHECK-NEXT: [[CALL:%.*]] = tail call <16 x double> @_Z5rootnDv16_dDv16_i(<16 x double> [[X]], <16 x i32> [[Y]])172; CHECK-NEXT: ret <16 x double> [[CALL]]173;174entry:175 %call = tail call <16 x double> @_Z5rootnDv16_dDv16_i(<16 x double> %x, <16 x i32> %y)176 ret <16 x double> %call177}178 179define half @test_rootn_f16(half %x, i32 %y) {180; CHECK-LABEL: define half @test_rootn_f16(181; CHECK-SAME: half [[X:%.*]], i32 [[Y:%.*]]) {182; CHECK-NEXT: entry:183; CHECK-NEXT: [[CALL:%.*]] = tail call half @_Z5rootnDhi(half [[X]], i32 [[Y]])184; CHECK-NEXT: ret half [[CALL]]185;186entry:187 %call = tail call half @_Z5rootnDhi(half %x, i32 %y)188 ret half %call189}190 191define <2 x half> @test_rootn_v2f16(<2 x half> %x, <2 x i32> %y) {192; CHECK-LABEL: define <2 x half> @test_rootn_v2f16(193; CHECK-SAME: <2 x half> [[X:%.*]], <2 x i32> [[Y:%.*]]) {194; CHECK-NEXT: entry:195; CHECK-NEXT: [[CALL:%.*]] = tail call <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half> [[X]], <2 x i32> [[Y]])196; CHECK-NEXT: ret <2 x half> [[CALL]]197;198entry:199 %call = tail call <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half> %x, <2 x i32> %y)200 ret <2 x half> %call201}202 203define <3 x half> @test_rootn_v3f16(<3 x half> %x, <3 x i32> %y) {204; CHECK-LABEL: define <3 x half> @test_rootn_v3f16(205; CHECK-SAME: <3 x half> [[X:%.*]], <3 x i32> [[Y:%.*]]) {206; CHECK-NEXT: entry:207; CHECK-NEXT: [[CALL:%.*]] = tail call <3 x half> @_Z5rootnDv3_DhDv3_i(<3 x half> [[X]], <3 x i32> [[Y]])208; CHECK-NEXT: ret <3 x half> [[CALL]]209;210entry:211 %call = tail call <3 x half> @_Z5rootnDv3_DhDv3_i(<3 x half> %x, <3 x i32> %y)212 ret <3 x half> %call213}214 215define <4 x half> @test_rootn_v4f16(<4 x half> %x, <4 x i32> %y) {216; CHECK-LABEL: define <4 x half> @test_rootn_v4f16(217; CHECK-SAME: <4 x half> [[X:%.*]], <4 x i32> [[Y:%.*]]) {218; CHECK-NEXT: entry:219; CHECK-NEXT: [[CALL:%.*]] = tail call <4 x half> @_Z5rootnDv4_DhDv4_i(<4 x half> [[X]], <4 x i32> [[Y]])220; CHECK-NEXT: ret <4 x half> [[CALL]]221;222entry:223 %call = tail call <4 x half> @_Z5rootnDv4_DhDv4_i(<4 x half> %x, <4 x i32> %y)224 ret <4 x half> %call225}226 227define <8 x half> @test_rootn_v8f16(<8 x half> %x, <8 x i32> %y) {228; CHECK-LABEL: define <8 x half> @test_rootn_v8f16(229; CHECK-SAME: <8 x half> [[X:%.*]], <8 x i32> [[Y:%.*]]) {230; CHECK-NEXT: entry:231; CHECK-NEXT: [[CALL:%.*]] = tail call <8 x half> @_Z5rootnDv8_DhDv8_i(<8 x half> [[X]], <8 x i32> [[Y]])232; CHECK-NEXT: ret <8 x half> [[CALL]]233;234entry:235 %call = tail call <8 x half> @_Z5rootnDv8_DhDv8_i(<8 x half> %x, <8 x i32> %y)236 ret <8 x half> %call237}238 239define <16 x half> @test_rootn_v16f16(<16 x half> %x, <16 x i32> %y) {240; CHECK-LABEL: define <16 x half> @test_rootn_v16f16(241; CHECK-SAME: <16 x half> [[X:%.*]], <16 x i32> [[Y:%.*]]) {242; CHECK-NEXT: entry:243; CHECK-NEXT: [[CALL:%.*]] = tail call <16 x half> @_Z5rootnDv16_DhDv16_i(<16 x half> [[X]], <16 x i32> [[Y]])244; CHECK-NEXT: ret <16 x half> [[CALL]]245;246entry:247 %call = tail call <16 x half> @_Z5rootnDv16_DhDv16_i(<16 x half> %x, <16 x i32> %y)248 ret <16 x half> %call249}250 251define half @test_rootn_f16_0(half %x) {252; CHECK-LABEL: define half @test_rootn_f16_0(253; CHECK-SAME: half [[X:%.*]]) {254; CHECK-NEXT: [[CALL:%.*]] = tail call half @_Z5rootnDhi(half [[X]], i32 0)255; CHECK-NEXT: ret half [[CALL]]256;257 %call = tail call half @_Z5rootnDhi(half %x, i32 0)258 ret half %call259}260 261define half @test_rootn_f16_1(half %x) {262; CHECK-LABEL: define half @test_rootn_f16_1(263; CHECK-SAME: half [[X:%.*]]) {264; CHECK-NEXT: ret half [[X]]265;266 %call = tail call half @_Z5rootnDhi(half %x, i32 1)267 ret half %call268}269 270define half @test_rootn_f16_2(half %x) {271; CHECK-LABEL: define half @test_rootn_f16_2(272; CHECK-SAME: half [[X:%.*]]) {273; CHECK-NEXT: [[CALL:%.*]] = call half @llvm.sqrt.f16(half [[X]]), !fpmath [[META0:![0-9]+]]274; CHECK-NEXT: ret half [[CALL]]275;276 %call = tail call half @_Z5rootnDhi(half %x, i32 2)277 ret half %call278}279 280define half @test_rootn_f16_3(half %x) {281; CHECK-LABEL: define half @test_rootn_f16_3(282; CHECK-SAME: half [[X:%.*]]) {283; CHECK-NEXT: [[__ROOTN2CBRT:%.*]] = call half @_Z4cbrtDh(half [[X]])284; CHECK-NEXT: ret half [[__ROOTN2CBRT]]285;286 %call = tail call half @_Z5rootnDhi(half %x, i32 3)287 ret half %call288}289 290define half @test_rootn_f16_neg1(half %x) {291; CHECK-LABEL: define half @test_rootn_f16_neg1(292; CHECK-SAME: half [[X:%.*]]) {293; CHECK-NEXT: [[__ROOTN2DIV:%.*]] = fdiv half 0xH3C00, [[X]]294; CHECK-NEXT: ret half [[__ROOTN2DIV]]295;296 %call = tail call half @_Z5rootnDhi(half %x, i32 -1)297 ret half %call298}299 300define half @test_rootn_f16_neg2(half %x) {301; CHECK-LABEL: define half @test_rootn_f16_neg2(302; CHECK-SAME: half [[X:%.*]]) {303; CHECK-NEXT: [[TMP1:%.*]] = call contract half @llvm.sqrt.f16(half [[X]])304; CHECK-NEXT: [[__ROOTN2RSQRT:%.*]] = fdiv contract half 0xH3C00, [[TMP1]], !fpmath [[META0]]305; CHECK-NEXT: ret half [[__ROOTN2RSQRT]]306;307 %call = tail call half @_Z5rootnDhi(half %x, i32 -2)308 ret half %call309}310 311define half @test_rootn_f16_neg3(half %x) {312; CHECK-LABEL: define half @test_rootn_f16_neg3(313; CHECK-SAME: half [[X:%.*]]) {314; CHECK-NEXT: [[CALL:%.*]] = tail call half @_Z5rootnDhi(half [[X]], i32 -3)315; CHECK-NEXT: ret half [[CALL]]316;317 %call = tail call half @_Z5rootnDhi(half %x, i32 -3)318 ret half %call319}320 321define half @test_rootn_f16_neg4(half %x) {322; CHECK-LABEL: define half @test_rootn_f16_neg4(323; CHECK-SAME: half [[X:%.*]]) {324; CHECK-NEXT: [[CALL:%.*]] = tail call half @_Z5rootnDhi(half [[X]], i32 -4)325; CHECK-NEXT: ret half [[CALL]]326;327 %call = tail call half @_Z5rootnDhi(half %x, i32 -4)328 ret half %call329}330 331define <2 x half> @test_rootn_v2f16_0(<2 x half> %x) {332; CHECK-LABEL: define <2 x half> @test_rootn_v2f16_0(333; CHECK-SAME: <2 x half> [[X:%.*]]) {334; CHECK-NEXT: [[CALL:%.*]] = tail call <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half> [[X]], <2 x i32> zeroinitializer)335; CHECK-NEXT: ret <2 x half> [[CALL]]336;337 %call = tail call <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half> %x, <2 x i32> zeroinitializer)338 ret <2 x half> %call339}340 341define <2 x half> @test_rootn_v2f16_1(<2 x half> %x) {342; CHECK-LABEL: define <2 x half> @test_rootn_v2f16_1(343; CHECK-SAME: <2 x half> [[X:%.*]]) {344; CHECK-NEXT: ret <2 x half> [[X]]345;346 %call = tail call <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half> %x, <2 x i32> <i32 1, i32 1>)347 ret <2 x half> %call348}349 350define <2 x half> @test_rootn_v2f16_2(<2 x half> %x) {351; CHECK-LABEL: define <2 x half> @test_rootn_v2f16_2(352; CHECK-SAME: <2 x half> [[X:%.*]]) {353; CHECK-NEXT: [[CALL:%.*]] = call <2 x half> @llvm.sqrt.v2f16(<2 x half> [[X]]), !fpmath [[META0]]354; CHECK-NEXT: ret <2 x half> [[CALL]]355;356 %call = tail call <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half> %x, <2 x i32> <i32 2, i32 2>)357 ret <2 x half> %call358}359 360define <2 x half> @test_rootn_v2f16_neg1(<2 x half> %x) {361; CHECK-LABEL: define <2 x half> @test_rootn_v2f16_neg1(362; CHECK-SAME: <2 x half> [[X:%.*]]) {363; CHECK-NEXT: [[__ROOTN2DIV:%.*]] = fdiv <2 x half> splat (half 0xH3C00), [[X]]364; CHECK-NEXT: ret <2 x half> [[__ROOTN2DIV]]365;366 %call = tail call <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half> %x, <2 x i32> <i32 -1, i32 -1>)367 ret <2 x half> %call368}369 370define <2 x half> @test_rootn_v2f16_neg2(<2 x half> %x) {371; CHECK-LABEL: define <2 x half> @test_rootn_v2f16_neg2(372; CHECK-SAME: <2 x half> [[X:%.*]]) {373; CHECK-NEXT: [[TMP1:%.*]] = call contract <2 x half> @llvm.sqrt.v2f16(<2 x half> [[X]])374; CHECK-NEXT: [[__ROOTN2RSQRT:%.*]] = fdiv contract <2 x half> splat (half 0xH3C00), [[TMP1]], !fpmath [[META0]]375; CHECK-NEXT: ret <2 x half> [[__ROOTN2RSQRT]]376;377 %call = tail call <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half> %x, <2 x i32> <i32 -2, i32 -2>)378 ret <2 x half> %call379}380 381define <2 x half> @test_rootn_v2f16_neg3(<2 x half> %x) {382; CHECK-LABEL: define <2 x half> @test_rootn_v2f16_neg3(383; CHECK-SAME: <2 x half> [[X:%.*]]) {384; CHECK-NEXT: [[CALL:%.*]] = tail call <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half> [[X]], <2 x i32> splat (i32 -3))385; CHECK-NEXT: ret <2 x half> [[CALL]]386;387 %call = tail call <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half> %x, <2 x i32> <i32 -3, i32 -3>)388 ret <2 x half> %call389}390 391define float @test_rootn_f32__y_0(float %x) {392; CHECK-LABEL: define float @test_rootn_f32__y_0(393; CHECK-SAME: float [[X:%.*]]) {394; CHECK-NEXT: entry:395; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 0)396; CHECK-NEXT: ret float [[CALL]]397;398entry:399 %call = tail call float @_Z5rootnfi(float %x, i32 0)400 ret float %call401}402 403define float @test_rootn_f32__y_poison(float %x) {404; CHECK-LABEL: define float @test_rootn_f32__y_poison(405; CHECK-SAME: float [[X:%.*]]) {406; CHECK-NEXT: entry:407; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 poison)408; CHECK-NEXT: ret float [[CALL]]409;410entry:411 %call = tail call float @_Z5rootnfi(float %x, i32 poison)412 ret float %call413}414 415define <2 x float> @test_rootn_v2f32__y_poison(<2 x float> %x) {416; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_poison(417; CHECK-SAME: <2 x float> [[X:%.*]]) {418; CHECK-NEXT: entry:419; CHECK-NEXT: [[CALL:%.*]] = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> [[X]], <2 x i32> poison)420; CHECK-NEXT: ret <2 x float> [[CALL]]421;422entry:423 %call = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> poison)424 ret <2 x float> %call425}426 427define <2 x float> @test_rootn_v2f32__y_0(<2 x float> %x) {428; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_0(429; CHECK-SAME: <2 x float> [[X:%.*]]) {430; CHECK-NEXT: entry:431; CHECK-NEXT: [[CALL:%.*]] = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> [[X]], <2 x i32> zeroinitializer)432; CHECK-NEXT: ret <2 x float> [[CALL]]433;434entry:435 %call = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> zeroinitializer)436 ret <2 x float> %call437}438 439define <2 x float> @test_rootn_v2f32__y_0_undef(<2 x float> %x) {440; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_0_undef(441; CHECK-SAME: <2 x float> [[X:%.*]]) {442; CHECK-NEXT: entry:443; CHECK-NEXT: [[CALL:%.*]] = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 0, i32 poison>)444; CHECK-NEXT: ret <2 x float> [[CALL]]445;446entry:447 %call = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 0, i32 poison>)448 ret <2 x float> %call449}450 451define <3 x float> @test_rootn_v3f32__y_0(<3 x float> %x) {452; CHECK-LABEL: define <3 x float> @test_rootn_v3f32__y_0(453; CHECK-SAME: <3 x float> [[X:%.*]]) {454; CHECK-NEXT: entry:455; CHECK-NEXT: [[CALL:%.*]] = tail call <3 x float> @_Z5rootnDv3_fDv3_i(<3 x float> [[X]], <3 x i32> zeroinitializer)456; CHECK-NEXT: ret <3 x float> [[CALL]]457;458entry:459 %call = tail call <3 x float> @_Z5rootnDv3_fDv3_i(<3 x float> %x, <3 x i32> zeroinitializer)460 ret <3 x float> %call461}462 463define <4 x float> @test_rootn_v4f32__y_0(<4 x float> %x) {464; CHECK-LABEL: define <4 x float> @test_rootn_v4f32__y_0(465; CHECK-SAME: <4 x float> [[X:%.*]]) {466; CHECK-NEXT: entry:467; CHECK-NEXT: [[CALL:%.*]] = tail call <4 x float> @_Z5rootnDv4_fDv4_i(<4 x float> [[X]], <4 x i32> zeroinitializer)468; CHECK-NEXT: ret <4 x float> [[CALL]]469;470entry:471 %call = tail call <4 x float> @_Z5rootnDv4_fDv4_i(<4 x float> %x, <4 x i32> zeroinitializer)472 ret <4 x float> %call473}474 475define <8 x float> @test_rootn_v8f32__y_0(<8 x float> %x) {476; CHECK-LABEL: define <8 x float> @test_rootn_v8f32__y_0(477; CHECK-SAME: <8 x float> [[X:%.*]]) {478; CHECK-NEXT: entry:479; CHECK-NEXT: [[CALL:%.*]] = tail call <8 x float> @_Z5rootnDv8_fDv8_i(<8 x float> [[X]], <8 x i32> zeroinitializer)480; CHECK-NEXT: ret <8 x float> [[CALL]]481;482entry:483 %call = tail call <8 x float> @_Z5rootnDv8_fDv8_i(<8 x float> %x, <8 x i32> zeroinitializer)484 ret <8 x float> %call485}486 487define <16 x float> @test_rootn_v16f32__y_0(<16 x float> %x) {488; CHECK-LABEL: define <16 x float> @test_rootn_v16f32__y_0(489; CHECK-SAME: <16 x float> [[X:%.*]]) {490; CHECK-NEXT: entry:491; CHECK-NEXT: [[CALL:%.*]] = tail call <16 x float> @_Z5rootnDv16_fDv16_i(<16 x float> [[X]], <16 x i32> zeroinitializer)492; CHECK-NEXT: ret <16 x float> [[CALL]]493;494entry:495 %call = tail call <16 x float> @_Z5rootnDv16_fDv16_i(<16 x float> %x, <16 x i32> zeroinitializer)496 ret <16 x float> %call497}498 499define float @test_rootn_f32__y_1(float %x) {500; CHECK-LABEL: define float @test_rootn_f32__y_1(501; CHECK-SAME: float [[X:%.*]]) {502; CHECK-NEXT: entry:503; CHECK-NEXT: ret float [[X]]504;505entry:506 %call = tail call float @_Z5rootnfi(float %x, i32 1)507 ret float %call508}509 510define float @test_rootn_f32__y_1__strictfp(float %x) #1 {511; CHECK-LABEL: define float @test_rootn_f32__y_1__strictfp(512; CHECK-SAME: float [[X:%.*]]) #[[ATTR0:[0-9]+]] {513; CHECK-NEXT: entry:514; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 1) #[[ATTR0]]515; CHECK-NEXT: ret float [[CALL]]516;517entry:518 %call = tail call float @_Z5rootnfi(float %x, i32 1) #1519 ret float %call520}521 522define <2 x float> @test_rootn_v2f32__y_1(<2 x float> %x) {523; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_1(524; CHECK-SAME: <2 x float> [[X:%.*]]) {525; CHECK-NEXT: entry:526; CHECK-NEXT: ret <2 x float> [[X]]527;528entry:529 %call = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 1, i32 1>)530 ret <2 x float> %call531}532 533define <2 x float> @test_rootn_v2f32__y_1__strictfp(<2 x float> %x) #1 {534; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_1__strictfp(535; CHECK-SAME: <2 x float> [[X:%.*]]) #[[ATTR0]] {536; CHECK-NEXT: entry:537; CHECK-NEXT: [[CALL:%.*]] = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 1)) #[[ATTR0]]538; CHECK-NEXT: ret <2 x float> [[CALL]]539;540entry:541 %call = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 1, i32 1>) #1542 ret <2 x float> %call543}544 545define <2 x float> @test_rootn_v2f32__y_1_undef(<2 x float> %x) {546; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_1_undef(547; CHECK-SAME: <2 x float> [[X:%.*]]) {548; CHECK-NEXT: entry:549; CHECK-NEXT: ret <2 x float> [[X]]550;551entry:552 %call = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 1, i32 poison>)553 ret <2 x float> %call554}555 556define <3 x float> @test_rootn_v3f32__y_1(<3 x float> %x) {557; CHECK-LABEL: define <3 x float> @test_rootn_v3f32__y_1(558; CHECK-SAME: <3 x float> [[X:%.*]]) {559; CHECK-NEXT: entry:560; CHECK-NEXT: ret <3 x float> [[X]]561;562entry:563 %call = tail call <3 x float> @_Z5rootnDv3_fDv3_i(<3 x float> %x, <3 x i32> <i32 1, i32 1, i32 1>)564 ret <3 x float> %call565}566 567define <3 x float> @test_rootn_v3f32__y_1_undef(<3 x float> %x) {568; CHECK-LABEL: define <3 x float> @test_rootn_v3f32__y_1_undef(569; CHECK-SAME: <3 x float> [[X:%.*]]) {570; CHECK-NEXT: entry:571; CHECK-NEXT: ret <3 x float> [[X]]572;573entry:574 %call = tail call <3 x float> @_Z5rootnDv3_fDv3_i(<3 x float> %x, <3 x i32> <i32 1, i32 1, i32 poison>)575 ret <3 x float> %call576}577 578define <4 x float> @test_rootn_v4f32__y_1(<4 x float> %x) {579; CHECK-LABEL: define <4 x float> @test_rootn_v4f32__y_1(580; CHECK-SAME: <4 x float> [[X:%.*]]) {581; CHECK-NEXT: entry:582; CHECK-NEXT: ret <4 x float> [[X]]583;584entry:585 %call = tail call <4 x float> @_Z5rootnDv4_fDv4_i(<4 x float> %x, <4 x i32> <i32 1, i32 1, i32 1, i32 1>)586 ret <4 x float> %call587}588 589define <8 x float> @test_rootn_v8f32__y_1(<8 x float> %x) {590; CHECK-LABEL: define <8 x float> @test_rootn_v8f32__y_1(591; CHECK-SAME: <8 x float> [[X:%.*]]) {592; CHECK-NEXT: entry:593; CHECK-NEXT: ret <8 x float> [[X]]594;595entry:596 %call = tail call <8 x float> @_Z5rootnDv8_fDv8_i(<8 x float> %x, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>)597 ret <8 x float> %call598}599 600define <16 x float> @test_rootn_v16f32__y_1(<16 x float> %x) {601; CHECK-LABEL: define <16 x float> @test_rootn_v16f32__y_1(602; CHECK-SAME: <16 x float> [[X:%.*]]) {603; CHECK-NEXT: entry:604; CHECK-NEXT: ret <16 x float> [[X]]605;606entry:607 %call = tail call <16 x float> @_Z5rootnDv16_fDv16_i(<16 x float> %x, <16 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>)608 ret <16 x float> %call609}610 611define float @test_rootn_f32__y_2(float %x) {612; CHECK-LABEL: define float @test_rootn_f32__y_2(613; CHECK-SAME: float [[X:%.*]]) {614; CHECK-NEXT: entry:615; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.sqrt.f32(float [[X]]), !fpmath [[META0]]616; CHECK-NEXT: ret float [[CALL]]617;618entry:619 %call = tail call float @_Z5rootnfi(float %x, i32 2)620 ret float %call621}622 623define float @test_rootn_f32__y_2_flags(float %x) {624; CHECK-LABEL: define float @test_rootn_f32__y_2_flags(625; CHECK-SAME: float [[X:%.*]]) {626; CHECK-NEXT: entry:627; CHECK-NEXT: [[CALL:%.*]] = call nnan nsz float @llvm.sqrt.f32(float [[X]]), !fpmath [[META0]]628; CHECK-NEXT: ret float [[CALL]]629;630entry:631 %call = tail call nnan nsz float @_Z5rootnfi(float %x, i32 2)632 ret float %call633}634 635; Should retain looser existing !fpmath requirements.636define float @test_rootn_f32__y_2_fpmath_3(float %x) {637; CHECK-LABEL: define float @test_rootn_f32__y_2_fpmath_3(638; CHECK-SAME: float [[X:%.*]]) {639; CHECK-NEXT: entry:640; CHECK-NEXT: [[CALL:%.*]] = call nnan nsz float @llvm.sqrt.f32(float [[X]]), !fpmath [[META1:![0-9]+]]641; CHECK-NEXT: ret float [[CALL]]642;643entry:644 %call = tail call nnan nsz float @_Z5rootnfi(float %x, i32 2), !fpmath !0645 ret float %call646}647 648define <2 x float> @test_rootn_v2f32__y_2_flags(<2 x float> %x) {649; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_2_flags(650; CHECK-SAME: <2 x float> [[X:%.*]]) {651; CHECK-NEXT: entry:652; CHECK-NEXT: [[CALL:%.*]] = call nnan nsz <2 x float> @llvm.sqrt.v2f32(<2 x float> [[X]]), !fpmath [[META0]]653; CHECK-NEXT: ret <2 x float> [[CALL]]654;655entry:656 %call = tail call nnan nsz <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 2, i32 2>)657 ret <2 x float> %call658}659 660define <3 x float> @test_rootn_v3f32__y_2(<3 x float> %x) {661; CHECK-LABEL: define <3 x float> @test_rootn_v3f32__y_2(662; CHECK-SAME: <3 x float> [[X:%.*]]) {663; CHECK-NEXT: entry:664; CHECK-NEXT: [[CALL:%.*]] = call <3 x float> @llvm.sqrt.v3f32(<3 x float> [[X]]), !fpmath [[META0]]665; CHECK-NEXT: ret <3 x float> [[CALL]]666;667entry:668 %call = tail call <3 x float> @_Z5rootnDv3_fDv3_i(<3 x float> %x, <3 x i32> <i32 2, i32 2, i32 2>)669 ret <3 x float> %call670}671 672define <3 x float> @test_rootn_v3f32__y_2_undef(<3 x float> %x) {673; CHECK-LABEL: define <3 x float> @test_rootn_v3f32__y_2_undef(674; CHECK-SAME: <3 x float> [[X:%.*]]) {675; CHECK-NEXT: entry:676; CHECK-NEXT: [[CALL:%.*]] = call <3 x float> @llvm.sqrt.v3f32(<3 x float> [[X]]), !fpmath [[META0]]677; CHECK-NEXT: ret <3 x float> [[CALL]]678;679entry:680 %call = tail call <3 x float> @_Z5rootnDv3_fDv3_i(<3 x float> %x, <3 x i32> <i32 2, i32 poison, i32 2>)681 ret <3 x float> %call682}683 684define <4 x float> @test_rootn_v4f32__y_2(<4 x float> %x) {685; CHECK-LABEL: define <4 x float> @test_rootn_v4f32__y_2(686; CHECK-SAME: <4 x float> [[X:%.*]]) {687; CHECK-NEXT: entry:688; CHECK-NEXT: [[CALL:%.*]] = call <4 x float> @llvm.sqrt.v4f32(<4 x float> [[X]]), !fpmath [[META0]]689; CHECK-NEXT: ret <4 x float> [[CALL]]690;691entry:692 %call = tail call <4 x float> @_Z5rootnDv4_fDv4_i(<4 x float> %x, <4 x i32> <i32 2, i32 2, i32 2, i32 2>)693 ret <4 x float> %call694}695 696define <8 x float> @test_rootn_v8f32__y_2(<8 x float> %x) {697; CHECK-LABEL: define <8 x float> @test_rootn_v8f32__y_2(698; CHECK-SAME: <8 x float> [[X:%.*]]) {699; CHECK-NEXT: entry:700; CHECK-NEXT: [[CALL:%.*]] = call <8 x float> @llvm.sqrt.v8f32(<8 x float> [[X]]), !fpmath [[META0]]701; CHECK-NEXT: ret <8 x float> [[CALL]]702;703entry:704 %call = tail call <8 x float> @_Z5rootnDv8_fDv8_i(<8 x float> %x, <8 x i32> <i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2>)705 ret <8 x float> %call706}707 708define <16 x float> @test_rootn_v16f32__y_2(<16 x float> %x) {709; CHECK-LABEL: define <16 x float> @test_rootn_v16f32__y_2(710; CHECK-SAME: <16 x float> [[X:%.*]]) {711; CHECK-NEXT: entry:712; CHECK-NEXT: [[CALL:%.*]] = call <16 x float> @llvm.sqrt.v16f32(<16 x float> [[X]]), !fpmath [[META0]]713; CHECK-NEXT: ret <16 x float> [[CALL]]714;715entry:716 %call = tail call <16 x float> @_Z5rootnDv16_fDv16_i(<16 x float> %x, <16 x i32> <i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2>)717 ret <16 x float> %call718}719 720define float @test_rootn_f32__y_3(float %x) {721; CHECK-LABEL: define float @test_rootn_f32__y_3(722; CHECK-SAME: float [[X:%.*]]) {723; CHECK-NEXT: entry:724; CHECK-NEXT: [[__ROOTN2CBRT:%.*]] = call float @_Z4cbrtf(float [[X]])725; CHECK-NEXT: ret float [[__ROOTN2CBRT]]726;727entry:728 %call = tail call float @_Z5rootnfi(float %x, i32 3)729 ret float %call730}731 732define <2 x float> @test_rootn_v2f32__y_3(<2 x float> %x) {733; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_3(734; CHECK-SAME: <2 x float> [[X:%.*]]) {735; CHECK-NEXT: entry:736; CHECK-NEXT: [[__ROOTN2CBRT:%.*]] = call <2 x float> @_Z4cbrtDv2_f(<2 x float> [[X]])737; CHECK-NEXT: ret <2 x float> [[__ROOTN2CBRT]]738;739entry:740 %call = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 3, i32 3>)741 ret <2 x float> %call742}743 744define <2 x float> @test_rootn_v2f32__y_nonsplat_2_3(<2 x float> %x) {745; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_nonsplat_2_3(746; CHECK-SAME: <2 x float> [[X:%.*]]) {747; CHECK-NEXT: entry:748; CHECK-NEXT: [[CALL:%.*]] = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 2, i32 3>)749; CHECK-NEXT: ret <2 x float> [[CALL]]750;751entry:752 %call = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 2, i32 3>)753 ret <2 x float> %call754}755 756define <2 x float> @test_rootn_v2f32__y_nonsplat_2_poison(<2 x float> %x) {757; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_nonsplat_2_poison(758; CHECK-SAME: <2 x float> [[X:%.*]]) {759; CHECK-NEXT: entry:760; CHECK-NEXT: [[CALL:%.*]] = call <2 x float> @llvm.sqrt.v2f32(<2 x float> [[X]]), !fpmath [[META0]]761; CHECK-NEXT: ret <2 x float> [[CALL]]762;763entry:764 %call = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 2, i32 poison>)765 ret <2 x float> %call766}767 768define <2 x float> @test_rootn_v2f32__y_nonsplat_2_5(<2 x float> %x) {769; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_nonsplat_2_5(770; CHECK-SAME: <2 x float> [[X:%.*]]) {771; CHECK-NEXT: entry:772; CHECK-NEXT: [[CALL:%.*]] = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 2, i32 5>)773; CHECK-NEXT: ret <2 x float> [[CALL]]774;775entry:776 %call = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 2, i32 5>)777 ret <2 x float> %call778}779 780define float @test_rootn_f32__y_neg1(float %x) {781; CHECK-LABEL: define float @test_rootn_f32__y_neg1(782; CHECK-SAME: float [[X:%.*]]) {783; CHECK-NEXT: entry:784; CHECK-NEXT: [[__ROOTN2DIV:%.*]] = fdiv float 1.000000e+00, [[X]]785; CHECK-NEXT: ret float [[__ROOTN2DIV]]786;787entry:788 %call = tail call float @_Z5rootnfi(float %x, i32 -1)789 ret float %call790}791 792define <2 x float> @test_rootn_v2f32__y_neg1(<2 x float> %x) {793; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_neg1(794; CHECK-SAME: <2 x float> [[X:%.*]]) {795; CHECK-NEXT: entry:796; CHECK-NEXT: [[__ROOTN2DIV:%.*]] = fdiv <2 x float> splat (float 1.000000e+00), [[X]]797; CHECK-NEXT: ret <2 x float> [[__ROOTN2DIV]]798;799entry:800 %call = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 -1, i32 -1>)801 ret <2 x float> %call802}803 804define <3 x float> @test_rootn_v3f32__y_neg1(<3 x float> %x) {805; CHECK-LABEL: define <3 x float> @test_rootn_v3f32__y_neg1(806; CHECK-SAME: <3 x float> [[X:%.*]]) {807; CHECK-NEXT: entry:808; CHECK-NEXT: [[__ROOTN2DIV:%.*]] = fdiv <3 x float> splat (float 1.000000e+00), [[X]]809; CHECK-NEXT: ret <3 x float> [[__ROOTN2DIV]]810;811entry:812 %call = tail call <3 x float> @_Z5rootnDv3_fDv3_i(<3 x float> %x, <3 x i32> <i32 -1, i32 -1, i32 -1>)813 ret <3 x float> %call814}815 816define <3 x float> @test_rootn_v3f32__y_neg1_undef(<3 x float> %x) {817; CHECK-LABEL: define <3 x float> @test_rootn_v3f32__y_neg1_undef(818; CHECK-SAME: <3 x float> [[X:%.*]]) {819; CHECK-NEXT: entry:820; CHECK-NEXT: [[__ROOTN2DIV:%.*]] = fdiv <3 x float> splat (float 1.000000e+00), [[X]]821; CHECK-NEXT: ret <3 x float> [[__ROOTN2DIV]]822;823entry:824 %call = tail call <3 x float> @_Z5rootnDv3_fDv3_i(<3 x float> %x, <3 x i32> <i32 -1, i32 -1, i32 poison>)825 ret <3 x float> %call826}827 828define <4 x float> @test_rootn_v4f32__y_neg1(<4 x float> %x) {829; CHECK-LABEL: define <4 x float> @test_rootn_v4f32__y_neg1(830; CHECK-SAME: <4 x float> [[X:%.*]]) {831; CHECK-NEXT: entry:832; CHECK-NEXT: [[__ROOTN2DIV:%.*]] = fdiv <4 x float> splat (float 1.000000e+00), [[X]]833; CHECK-NEXT: ret <4 x float> [[__ROOTN2DIV]]834;835entry:836 %call = tail call <4 x float> @_Z5rootnDv4_fDv4_i(<4 x float> %x, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>)837 ret <4 x float> %call838}839 840define <8 x float> @test_rootn_v8f32__y_neg1(<8 x float> %x) {841; CHECK-LABEL: define <8 x float> @test_rootn_v8f32__y_neg1(842; CHECK-SAME: <8 x float> [[X:%.*]]) {843; CHECK-NEXT: entry:844; CHECK-NEXT: [[__ROOTN2DIV:%.*]] = fdiv <8 x float> splat (float 1.000000e+00), [[X]]845; CHECK-NEXT: ret <8 x float> [[__ROOTN2DIV]]846;847entry:848 %call = tail call <8 x float> @_Z5rootnDv8_fDv8_i(<8 x float> %x, <8 x i32> <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>)849 ret <8 x float> %call850}851 852define <16 x float> @test_rootn_v16f32__y_neg1(<16 x float> %x) {853; CHECK-LABEL: define <16 x float> @test_rootn_v16f32__y_neg1(854; CHECK-SAME: <16 x float> [[X:%.*]]) {855; CHECK-NEXT: entry:856; CHECK-NEXT: [[__ROOTN2DIV:%.*]] = fdiv <16 x float> splat (float 1.000000e+00), [[X]]857; CHECK-NEXT: ret <16 x float> [[__ROOTN2DIV]]858;859entry:860 %call = tail call <16 x float> @_Z5rootnDv16_fDv16_i(<16 x float> %x, <16 x i32> <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>)861 ret <16 x float> %call862}863 864define float @test_rootn_f32__y_neg2(float %x) {865; CHECK-LABEL: define float @test_rootn_f32__y_neg2(866; CHECK-SAME: float [[X:%.*]]) {867; CHECK-NEXT: entry:868; CHECK-NEXT: [[TMP0:%.*]] = call contract float @llvm.sqrt.f32(float [[X]])869; CHECK-NEXT: [[__ROOTN2RSQRT:%.*]] = fdiv contract float 1.000000e+00, [[TMP0]], !fpmath [[META0]]870; CHECK-NEXT: ret float [[__ROOTN2RSQRT]]871;872entry:873 %call = tail call float @_Z5rootnfi(float %x, i32 -2)874 ret float %call875}876 877define float @test_rootn_f32__y_neg2__flags(float %x) {878; CHECK-LABEL: define float @test_rootn_f32__y_neg2__flags(879; CHECK-SAME: float [[X:%.*]]) {880; CHECK-NEXT: entry:881; CHECK-NEXT: [[TMP0:%.*]] = call nnan nsz contract float @llvm.sqrt.f32(float [[X]])882; CHECK-NEXT: [[__ROOTN2RSQRT:%.*]] = fdiv nnan nsz contract float 1.000000e+00, [[TMP0]], !fpmath [[META0]]883; CHECK-NEXT: ret float [[__ROOTN2RSQRT]]884;885entry:886 %call = tail call nsz nnan float @_Z5rootnfi(float %x, i32 -2)887 ret float %call888}889 890define float @test_rootn_f32__y_neg2__strictfp(float %x) #1 {891; CHECK-LABEL: define float @test_rootn_f32__y_neg2__strictfp(892; CHECK-SAME: float [[X:%.*]]) #[[ATTR0]] {893; CHECK-NEXT: entry:894; CHECK-NEXT: [[__ROOTN2RSQRT:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 -2) #[[ATTR0]]895; CHECK-NEXT: ret float [[__ROOTN2RSQRT]]896;897entry:898 %call = tail call float @_Z5rootnfi(float %x, i32 -2) #1899 ret float %call900}901 902define float @test_rootn_f32__y_neg2__noinline(float %x) {903; CHECK-LABEL: define float @test_rootn_f32__y_neg2__noinline(904; CHECK-SAME: float [[X:%.*]]) {905; CHECK-NEXT: entry:906; CHECK-NEXT: [[__ROOTN2RSQRT:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 -2) #[[ATTR3:[0-9]+]]907; CHECK-NEXT: ret float [[__ROOTN2RSQRT]]908;909entry:910 %call = tail call float @_Z5rootnfi(float %x, i32 -2) #2911 ret float %call912}913 914define float @test_rootn_f32__y_neg2__nobuiltin(float %x) {915; CHECK-LABEL: define float @test_rootn_f32__y_neg2__nobuiltin(916; CHECK-SAME: float [[X:%.*]]) {917; CHECK-NEXT: entry:918; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 -2) #[[ATTR4:[0-9]+]]919; CHECK-NEXT: ret float [[CALL]]920;921entry:922 %call = tail call float @_Z5rootnfi(float %x, i32 -2) #0923 ret float %call924}925 926define <2 x float> @test_rootn_v2f32__y_neg2(<2 x float> %x) {927; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_neg2(928; CHECK-SAME: <2 x float> [[X:%.*]]) {929; CHECK-NEXT: entry:930; CHECK-NEXT: [[TMP0:%.*]] = call contract <2 x float> @llvm.sqrt.v2f32(<2 x float> [[X]])931; CHECK-NEXT: [[__ROOTN2RSQRT:%.*]] = fdiv contract <2 x float> splat (float 1.000000e+00), [[TMP0]], !fpmath [[META0]]932; CHECK-NEXT: ret <2 x float> [[__ROOTN2RSQRT]]933;934entry:935 %call = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 -2, i32 -2>)936 ret <2 x float> %call937}938 939define <2 x float> @test_rootn_v2f32__y_neg2__flags(<2 x float> %x) {940; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_neg2__flags(941; CHECK-SAME: <2 x float> [[X:%.*]]) {942; CHECK-NEXT: entry:943; CHECK-NEXT: [[TMP0:%.*]] = call nnan nsz contract <2 x float> @llvm.sqrt.v2f32(<2 x float> [[X]])944; CHECK-NEXT: [[__ROOTN2RSQRT:%.*]] = fdiv nnan nsz contract <2 x float> splat (float 1.000000e+00), [[TMP0]], !fpmath [[META0]]945; CHECK-NEXT: ret <2 x float> [[__ROOTN2RSQRT]]946;947entry:948 %call = tail call nsz nnan <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 -2, i32 -2>)949 ret <2 x float> %call950}951 952define <2 x float> @test_rootn_v2f32__y_neg2__strictfp(<2 x float> %x) #1 {953; CHECK-LABEL: define <2 x float> @test_rootn_v2f32__y_neg2__strictfp(954; CHECK-SAME: <2 x float> [[X:%.*]]) #[[ATTR0]] {955; CHECK-NEXT: entry:956; CHECK-NEXT: [[__ROOTN2RSQRT:%.*]] = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -2)) #[[ATTR0]]957; CHECK-NEXT: ret <2 x float> [[__ROOTN2RSQRT]]958;959entry:960 %call = tail call <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 -2, i32 -2>) #1961 ret <2 x float> %call962}963 964define float @test_rootn_f32__y_neg3(float %x) {965; CHECK-LABEL: define float @test_rootn_f32__y_neg3(966; CHECK-SAME: float [[X:%.*]]) {967; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 -3)968; CHECK-NEXT: ret float [[CALL]]969;970 %call = tail call float @_Z5rootnfi(float %x, i32 -3)971 ret float %call972}973 974define float @test_rootn_f32__y_neg4(float %x) {975; CHECK-LABEL: define float @test_rootn_f32__y_neg4(976; CHECK-SAME: float [[X:%.*]]) {977; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 -4)978; CHECK-NEXT: ret float [[CALL]]979;980 %call = tail call float @_Z5rootnfi(float %x, i32 -4)981 ret float %call982}983 984define float @test_rootn_afn_f32(float %x, i32 %y) {985; CHECK-LABEL: define float @test_rootn_afn_f32(986; CHECK-SAME: float [[X:%.*]], i32 [[Y:%.*]]) {987; CHECK-NEXT: entry:988; CHECK-NEXT: [[CALL:%.*]] = tail call afn float @_Z5rootnfi(float [[X]], i32 [[Y]])989; CHECK-NEXT: ret float [[CALL]]990;991entry:992 %call = tail call afn float @_Z5rootnfi(float %x, i32 %y)993 ret float %call994}995 996define <2 x float> @test_rootn_afn_v2f32(<2 x float> %x, <2 x i32> %y) {997; CHECK-LABEL: define <2 x float> @test_rootn_afn_v2f32(998; CHECK-SAME: <2 x float> [[X:%.*]], <2 x i32> [[Y:%.*]]) {999; CHECK-NEXT: entry:1000; CHECK-NEXT: [[CALL:%.*]] = tail call afn <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> [[X]], <2 x i32> [[Y]])1001; CHECK-NEXT: ret <2 x float> [[CALL]]1002;1003entry:1004 %call = tail call afn <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> %y)1005 ret <2 x float> %call1006}1007 1008define double @test_rootn_afn_f64(double %x, i32 %y) {1009; CHECK-LABEL: define double @test_rootn_afn_f64(1010; CHECK-SAME: double [[X:%.*]], i32 [[Y:%.*]]) {1011; CHECK-NEXT: entry:1012; CHECK-NEXT: [[CALL:%.*]] = tail call afn double @_Z5rootndi(double [[X]], i32 [[Y]])1013; CHECK-NEXT: ret double [[CALL]]1014;1015entry:1016 %call = tail call afn double @_Z5rootndi(double %x, i32 %y)1017 ret double %call1018}1019 1020define <2 x double> @test_rootn_afn_v2f64(<2 x double> %x, <2 x i32> %y) {1021; CHECK-LABEL: define <2 x double> @test_rootn_afn_v2f64(1022; CHECK-SAME: <2 x double> [[X:%.*]], <2 x i32> [[Y:%.*]]) {1023; CHECK-NEXT: entry:1024; CHECK-NEXT: [[CALL:%.*]] = tail call afn <2 x double> @_Z5rootnDv2_dDv2_i(<2 x double> [[X]], <2 x i32> [[Y]])1025; CHECK-NEXT: ret <2 x double> [[CALL]]1026;1027entry:1028 %call = tail call afn <2 x double> @_Z5rootnDv2_dDv2_i(<2 x double> %x, <2 x i32> %y)1029 ret <2 x double> %call1030}1031 1032define half @test_rootn_afn_f16(half %x, i32 %y) {1033; CHECK-LABEL: define half @test_rootn_afn_f16(1034; CHECK-SAME: half [[X:%.*]], i32 [[Y:%.*]]) {1035; CHECK-NEXT: entry:1036; CHECK-NEXT: [[CALL:%.*]] = tail call afn half @_Z5rootnDhi(half [[X]], i32 [[Y]])1037; CHECK-NEXT: ret half [[CALL]]1038;1039entry:1040 %call = tail call afn half @_Z5rootnDhi(half %x, i32 %y)1041 ret half %call1042}1043 1044define <2 x half> @test_rootn_afn_v2f16(<2 x half> %x, <2 x i32> %y) {1045; CHECK-LABEL: define <2 x half> @test_rootn_afn_v2f16(1046; CHECK-SAME: <2 x half> [[X:%.*]], <2 x i32> [[Y:%.*]]) {1047; CHECK-NEXT: entry:1048; CHECK-NEXT: [[CALL:%.*]] = tail call afn <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half> [[X]], <2 x i32> [[Y]])1049; CHECK-NEXT: ret <2 x half> [[CALL]]1050;1051entry:1052 %call = tail call afn <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half> %x, <2 x i32> %y)1053 ret <2 x half> %call1054}1055 1056define float @test_rootn_afn_nnan_ninf_f32(float %x, i32 %y) {1057; CHECK-LABEL: define float @test_rootn_afn_nnan_ninf_f32(1058; CHECK-SAME: float [[X:%.*]], i32 [[Y:%.*]]) {1059; CHECK-NEXT: entry:1060; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn float @_Z5rootnfi(float [[X]], i32 [[Y]])1061; CHECK-NEXT: ret float [[CALL]]1062;1063entry:1064 %call = tail call nnan ninf afn float @_Z5rootnfi(float %x, i32 %y)1065 ret float %call1066}1067 1068define <2 x float> @test_rootn_afn_nnan_ninf_v2f32(<2 x float> %x, <2 x i32> %y) {1069; CHECK-LABEL: define <2 x float> @test_rootn_afn_nnan_ninf_v2f32(1070; CHECK-SAME: <2 x float> [[X:%.*]], <2 x i32> [[Y:%.*]]) {1071; CHECK-NEXT: entry:1072; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> [[X]], <2 x i32> [[Y]])1073; CHECK-NEXT: ret <2 x float> [[CALL]]1074;1075entry:1076 %call = tail call nnan ninf afn <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> %y)1077 ret <2 x float> %call1078}1079 1080define double @test_rootn_afn_nnan_ninf_f64(double %x, i32 %y) {1081; CHECK-LABEL: define double @test_rootn_afn_nnan_ninf_f64(1082; CHECK-SAME: double [[X:%.*]], i32 [[Y:%.*]]) {1083; CHECK-NEXT: entry:1084; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn double @_Z5rootndi(double [[X]], i32 [[Y]])1085; CHECK-NEXT: ret double [[CALL]]1086;1087entry:1088 %call = tail call nnan ninf afn double @_Z5rootndi(double %x, i32 %y)1089 ret double %call1090}1091 1092define <2 x double> @test_rootn_afn_nnan_ninf_v2f64(<2 x double> %x, <2 x i32> %y) {1093; CHECK-LABEL: define <2 x double> @test_rootn_afn_nnan_ninf_v2f64(1094; CHECK-SAME: <2 x double> [[X:%.*]], <2 x i32> [[Y:%.*]]) {1095; CHECK-NEXT: entry:1096; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn <2 x double> @_Z5rootnDv2_dDv2_i(<2 x double> [[X]], <2 x i32> [[Y]])1097; CHECK-NEXT: ret <2 x double> [[CALL]]1098;1099entry:1100 %call = tail call nnan ninf afn <2 x double> @_Z5rootnDv2_dDv2_i(<2 x double> %x, <2 x i32> %y)1101 ret <2 x double> %call1102}1103 1104define half @test_rootn_afn_nnan_ninf_f16(half %x, i32 %y) {1105; CHECK-LABEL: define half @test_rootn_afn_nnan_ninf_f16(1106; CHECK-SAME: half [[X:%.*]], i32 [[Y:%.*]]) {1107; CHECK-NEXT: entry:1108; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn half @_Z5rootnDhi(half [[X]], i32 [[Y]])1109; CHECK-NEXT: ret half [[CALL]]1110;1111entry:1112 %call = tail call nnan ninf afn half @_Z5rootnDhi(half %x, i32 %y)1113 ret half %call1114}1115 1116define <2 x half> @test_rootn_afn_nnan_ninf_v2f16(<2 x half> %x, <2 x i32> %y) {1117; CHECK-LABEL: define <2 x half> @test_rootn_afn_nnan_ninf_v2f16(1118; CHECK-SAME: <2 x half> [[X:%.*]], <2 x i32> [[Y:%.*]]) {1119; CHECK-NEXT: entry:1120; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half> [[X]], <2 x i32> [[Y]])1121; CHECK-NEXT: ret <2 x half> [[CALL]]1122;1123entry:1124 %call = tail call nnan ninf afn <2 x half> @_Z5rootnDv2_DhDv2_i(<2 x half> %x, <2 x i32> %y)1125 ret <2 x half> %call1126}1127 1128define float @test_rootn_fast_f32_nobuiltin(float %x, i32 %y) {1129; CHECK-LABEL: define float @test_rootn_fast_f32_nobuiltin(1130; CHECK-SAME: float [[X:%.*]], i32 [[Y:%.*]]) {1131; CHECK-NEXT: entry:1132; CHECK-NEXT: [[CALL:%.*]] = tail call fast float @_Z5rootnfi(float [[X]], i32 [[Y]]) #[[ATTR4]]1133; CHECK-NEXT: ret float [[CALL]]1134;1135entry:1136 %call = tail call fast float @_Z5rootnfi(float %x, i32 %y) #01137 ret float %call1138}1139 1140define float @test_rootn_fast_f32_strictfp(float %x, i32 %y) #1 {1141; CHECK-LABEL: define float @test_rootn_fast_f32_strictfp(1142; CHECK-SAME: float [[X:%.*]], i32 [[Y:%.*]]) #[[ATTR0]] {1143; CHECK-NEXT: entry:1144; CHECK-NEXT: [[CALL:%.*]] = tail call fast float @_Z5rootnfi(float [[X]], i32 [[Y]]) #[[ATTR0]]1145; CHECK-NEXT: ret float [[CALL]]1146;1147entry:1148 %call = tail call fast float @_Z5rootnfi(float %x, i32 %y) #11149 ret float %call1150}1151 1152define float @test_rootn_fast_f32__y_poison(float %x) {1153; CHECK-LABEL: define float @test_rootn_fast_f32__y_poison(1154; CHECK-SAME: float [[X:%.*]]) {1155; CHECK-NEXT: [[CALL:%.*]] = tail call fast float @_Z5rootnfi(float [[X]], i32 poison)1156; CHECK-NEXT: ret float [[CALL]]1157;1158 %call = tail call fast float @_Z5rootnfi(float %x, i32 poison)1159 ret float %call1160}1161 1162define float @test_rootn_afn_nnan_ninf_f32__y_3(float %x) {1163; CHECK-LABEL: define float @test_rootn_afn_nnan_ninf_f32__y_3(1164; CHECK-SAME: float [[X:%.*]]) {1165; CHECK-NEXT: [[__ROOTN2CBRT:%.*]] = call nnan ninf afn float @_Z4cbrtf(float [[X]])1166; CHECK-NEXT: ret float [[__ROOTN2CBRT]]1167;1168 %call = tail call nnan ninf afn float @_Z5rootnfi(float %x, i32 3)1169 ret float %call1170}1171 1172define float @test_rootn_afn_nnan_ninf_f32__y_neg3(float %x) {1173; CHECK-LABEL: define float @test_rootn_afn_nnan_ninf_f32__y_neg3(1174; CHECK-SAME: float [[X:%.*]]) {1175; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn float @_Z5rootnfi(float [[X]], i32 -3)1176; CHECK-NEXT: ret float [[CALL]]1177;1178 %call = tail call nnan ninf afn float @_Z5rootnfi(float %x, i32 -3)1179 ret float %call1180}1181 1182define float @test_rootn_afn_nnan_ninf_f32__y_4(float %x) {1183; CHECK-LABEL: define float @test_rootn_afn_nnan_ninf_f32__y_4(1184; CHECK-SAME: float [[X:%.*]]) {1185; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn float @_Z5rootnfi(float [[X]], i32 4)1186; CHECK-NEXT: ret float [[CALL]]1187;1188 %call = tail call nnan ninf afn float @_Z5rootnfi(float %x, i32 4)1189 ret float %call1190}1191 1192define float @test_rootn_afn_nnan_ninf_f32__y_neg4(float %x) {1193; CHECK-LABEL: define float @test_rootn_afn_nnan_ninf_f32__y_neg4(1194; CHECK-SAME: float [[X:%.*]]) {1195; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn float @_Z5rootnfi(float [[X]], i32 -4)1196; CHECK-NEXT: ret float [[CALL]]1197;1198 %call = tail call nnan ninf afn float @_Z5rootnfi(float %x, i32 -4)1199 ret float %call1200}1201 1202define float @test_rootn_afn_nnan_ninf_f32__y_5(float %x) {1203; CHECK-LABEL: define float @test_rootn_afn_nnan_ninf_f32__y_5(1204; CHECK-SAME: float [[X:%.*]]) {1205; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn float @_Z5rootnfi(float [[X]], i32 5)1206; CHECK-NEXT: ret float [[CALL]]1207;1208 %call = tail call nnan ninf afn float @_Z5rootnfi(float %x, i32 5)1209 ret float %call1210}1211 1212define float @test_rootn_afn_nnan_ninf_f32__y_neg5(float %x) {1213; CHECK-LABEL: define float @test_rootn_afn_nnan_ninf_f32__y_neg5(1214; CHECK-SAME: float [[X:%.*]]) {1215; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn float @_Z5rootnfi(float [[X]], i32 -5)1216; CHECK-NEXT: ret float [[CALL]]1217;1218 %call = tail call nnan ninf afn float @_Z5rootnfi(float %x, i32 -5)1219 ret float %call1220}1221 1222define float @test_rootn_afn_nnan_ninf_f32__y_7(float %x) {1223; CHECK-LABEL: define float @test_rootn_afn_nnan_ninf_f32__y_7(1224; CHECK-SAME: float [[X:%.*]]) {1225; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn float @_Z5rootnfi(float [[X]], i32 7)1226; CHECK-NEXT: ret float [[CALL]]1227;1228 %call = tail call nnan ninf afn float @_Z5rootnfi(float %x, i32 7)1229 ret float %call1230}1231 1232define float @test_rootn_afn_nnan_ninf_f32__y_neg7(float %x) {1233; CHECK-LABEL: define float @test_rootn_afn_nnan_ninf_f32__y_neg7(1234; CHECK-SAME: float [[X:%.*]]) {1235; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn float @_Z5rootnfi(float [[X]], i32 -7)1236; CHECK-NEXT: ret float [[CALL]]1237;1238 %call = tail call nnan ninf afn float @_Z5rootnfi(float %x, i32 -7)1239 ret float %call1240}1241 1242define float @test_rootn_afn_nnan_ninf_f32__y_8(float %x) {1243; CHECK-LABEL: define float @test_rootn_afn_nnan_ninf_f32__y_8(1244; CHECK-SAME: float [[X:%.*]]) {1245; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn float @_Z5rootnfi(float [[X]], i32 8)1246; CHECK-NEXT: ret float [[CALL]]1247;1248 %call = tail call nnan ninf afn float @_Z5rootnfi(float %x, i32 8)1249 ret float %call1250}1251 1252define float @test_rootn_afn_nnan_ninf_f32__y_neg8(float %x) {1253; CHECK-LABEL: define float @test_rootn_afn_nnan_ninf_f32__y_neg8(1254; CHECK-SAME: float [[X:%.*]]) {1255; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn float @_Z5rootnfi(float [[X]], i32 -8)1256; CHECK-NEXT: ret float [[CALL]]1257;1258 %call = tail call nnan ninf afn float @_Z5rootnfi(float %x, i32 -8)1259 ret float %call1260}1261 1262define <2 x float> @test_rootn_afn_nnan_ninf_v2f32__y_3(<2 x float> %x) {1263; CHECK-LABEL: define <2 x float> @test_rootn_afn_nnan_ninf_v2f32__y_3(1264; CHECK-SAME: <2 x float> [[X:%.*]]) {1265; CHECK-NEXT: entry:1266; CHECK-NEXT: [[__ROOTN2CBRT:%.*]] = call nnan ninf afn <2 x float> @_Z4cbrtDv2_f(<2 x float> [[X]])1267; CHECK-NEXT: ret <2 x float> [[__ROOTN2CBRT]]1268;1269entry:1270 %call = tail call afn nnan ninf <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 3, i32 3>)1271 ret <2 x float> %call1272}1273 1274define <2 x float> @test_rootn_afn_nnan_ninf_v2f32__y_4(<2 x float> %x) {1275; CHECK-LABEL: define <2 x float> @test_rootn_afn_nnan_ninf_v2f32__y_4(1276; CHECK-SAME: <2 x float> [[X:%.*]]) {1277; CHECK-NEXT: entry:1278; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 4))1279; CHECK-NEXT: ret <2 x float> [[CALL]]1280;1281entry:1282 %call = tail call afn nnan ninf <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 4, i32 4>)1283 ret <2 x float> %call1284}1285 1286define <2 x float> @test_rootn_afn_nnan_ninf_v2f32__y_neg3(<2 x float> %x) {1287; CHECK-LABEL: define <2 x float> @test_rootn_afn_nnan_ninf_v2f32__y_neg3(1288; CHECK-SAME: <2 x float> [[X:%.*]]) {1289; CHECK-NEXT: entry:1290; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -3))1291; CHECK-NEXT: ret <2 x float> [[CALL]]1292;1293entry:1294 %call = tail call afn nnan ninf <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 -3, i32 -3>)1295 ret <2 x float> %call1296}1297 1298define <2 x float> @test_rootn_afn_nnan_ninf_v2f32__y_neg4(<2 x float> %x) {1299; CHECK-LABEL: define <2 x float> @test_rootn_afn_nnan_ninf_v2f32__y_neg4(1300; CHECK-SAME: <2 x float> [[X:%.*]]) {1301; CHECK-NEXT: entry:1302; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -4))1303; CHECK-NEXT: ret <2 x float> [[CALL]]1304;1305entry:1306 %call = tail call afn nnan ninf <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 -4, i32 -4>)1307 ret <2 x float> %call1308}1309 1310define <2 x float> @test_rootn_afn_nnan_ninf_v2f32__y_5(<2 x float> %x) {1311; CHECK-LABEL: define <2 x float> @test_rootn_afn_nnan_ninf_v2f32__y_5(1312; CHECK-SAME: <2 x float> [[X:%.*]]) {1313; CHECK-NEXT: entry:1314; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 5))1315; CHECK-NEXT: ret <2 x float> [[CALL]]1316;1317entry:1318 %call = tail call afn nnan ninf <2 x float> @_Z5rootnDv2_fDv2_i(<2 x float> %x, <2 x i32> <i32 5, i32 5>)1319 ret <2 x float> %call1320}1321 1322define float @test_rootn_f32__x_known_positive(float nofpclass(ninf nsub nnorm) %x, i32 %y) {1323; CHECK-LABEL: define float @test_rootn_f32__x_known_positive(1324; CHECK-SAME: float nofpclass(ninf nsub nnorm) [[X:%.*]], i32 [[Y:%.*]]) {1325; CHECK-NEXT: entry:1326; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 [[Y]])1327; CHECK-NEXT: ret float [[CALL]]1328;1329entry:1330 %call = tail call float @_Z5rootnfi(float %x, i32 %y)1331 ret float %call1332}1333 1334define float @test_rootn_afn_f32__x_known_positive(float nofpclass(ninf nsub nnorm) %x, i32 %y) {1335; CHECK-LABEL: define float @test_rootn_afn_f32__x_known_positive(1336; CHECK-SAME: float nofpclass(ninf nsub nnorm) [[X:%.*]], i32 [[Y:%.*]]) {1337; CHECK-NEXT: entry:1338; CHECK-NEXT: [[CALL:%.*]] = tail call afn float @_Z5rootnfi(float [[X]], i32 [[Y]])1339; CHECK-NEXT: ret float [[CALL]]1340;1341entry:1342 %call = tail call afn float @_Z5rootnfi(float %x, i32 %y)1343 ret float %call1344}1345 1346define float @test_rootn_afn_ninf_nnan_f32__x_known_positive(float nofpclass(ninf nsub nnorm) %x, i32 %y) {1347; CHECK-LABEL: define float @test_rootn_afn_ninf_nnan_f32__x_known_positive(1348; CHECK-SAME: float nofpclass(ninf nsub nnorm) [[X:%.*]], i32 [[Y:%.*]]) {1349; CHECK-NEXT: entry:1350; CHECK-NEXT: [[CALL:%.*]] = tail call nnan ninf afn float @_Z5rootnfi(float [[X]], i32 [[Y]])1351; CHECK-NEXT: ret float [[CALL]]1352;1353entry:1354 %call = tail call afn ninf nnan float @_Z5rootnfi(float %x, i32 %y)1355 ret float %call1356}1357 1358define float @test_rootn_afn_f32__x_known_positive__y_4(float nofpclass(ninf nsub nnorm) %x) {1359; CHECK-LABEL: define float @test_rootn_afn_f32__x_known_positive__y_4(1360; CHECK-SAME: float nofpclass(ninf nsub nnorm) [[X:%.*]]) {1361; CHECK-NEXT: entry:1362; CHECK-NEXT: [[CALL:%.*]] = tail call afn float @_Z5rootnfi(float [[X]], i32 4)1363; CHECK-NEXT: ret float [[CALL]]1364;1365entry:1366 %call = tail call afn float @_Z5rootnfi(float %x, i32 4)1367 ret float %call1368}1369 1370define float @test_rootn_f32__x_known_positive__y_4(float nofpclass(ninf nsub nnorm) %x) {1371; CHECK-LABEL: define float @test_rootn_f32__x_known_positive__y_4(1372; CHECK-SAME: float nofpclass(ninf nsub nnorm) [[X:%.*]]) {1373; CHECK-NEXT: entry:1374; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 4)1375; CHECK-NEXT: ret float [[CALL]]1376;1377entry:1378 %call = tail call float @_Z5rootnfi(float %x, i32 4)1379 ret float %call1380}1381 1382define float @test_rootn_f32_y_known_even(float %x, i32 %y.arg) {1383; CHECK-LABEL: define float @test_rootn_f32_y_known_even(1384; CHECK-SAME: float [[X:%.*]], i32 [[Y_ARG:%.*]]) {1385; CHECK-NEXT: entry:1386; CHECK-NEXT: [[Y:%.*]] = shl i32 [[Y_ARG]], 11387; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 [[Y]])1388; CHECK-NEXT: ret float [[CALL]]1389;1390entry:1391 %y = shl i32 %y.arg, 11392 %call = tail call float @_Z5rootnfi(float %x, i32 %y)1393 ret float %call1394}1395 1396define float @test_fast_rootn_f32_y_known_even(float %x, i32 %y.arg) {1397; CHECK-LABEL: define float @test_fast_rootn_f32_y_known_even(1398; CHECK-SAME: float [[X:%.*]], i32 [[Y_ARG:%.*]]) {1399; CHECK-NEXT: entry:1400; CHECK-NEXT: [[Y:%.*]] = shl i32 [[Y_ARG]], 11401; CHECK-NEXT: [[CALL:%.*]] = tail call fast float @_Z5rootnfi(float [[X]], i32 [[Y]])1402; CHECK-NEXT: ret float [[CALL]]1403;1404entry:1405 %y = shl i32 %y.arg, 11406 %call = tail call fast float @_Z5rootnfi(float %x, i32 %y)1407 ret float %call1408}1409 1410define float @test_fast_rootn_f32_known_positive_y_known_even(float nofpclass(ninf nsub nnorm) %x, i32 %y.arg) {1411; CHECK-LABEL: define float @test_fast_rootn_f32_known_positive_y_known_even(1412; CHECK-SAME: float nofpclass(ninf nsub nnorm) [[X:%.*]], i32 [[Y_ARG:%.*]]) {1413; CHECK-NEXT: entry:1414; CHECK-NEXT: [[Y:%.*]] = shl i32 [[Y_ARG]], 11415; CHECK-NEXT: [[CALL:%.*]] = tail call fast float @_Z5rootnfi(float [[X]], i32 [[Y]])1416; CHECK-NEXT: ret float [[CALL]]1417;1418entry:1419 %y = shl i32 %y.arg, 11420 %call = tail call fast float @_Z5rootnfi(float %x, i32 %y)1421 ret float %call1422}1423 1424define float @test_rootn_f32__y_0_nobuiltin(float %x) {1425; CHECK-LABEL: define float @test_rootn_f32__y_0_nobuiltin(1426; CHECK-SAME: float [[X:%.*]]) {1427; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 0) #[[ATTR4]]1428; CHECK-NEXT: ret float [[CALL]]1429;1430 %call = tail call float @_Z5rootnfi(float %x, i32 0) #01431 ret float %call1432}1433 1434define float @test_rootn_f32__y_1_nobuiltin(float %x) {1435; CHECK-LABEL: define float @test_rootn_f32__y_1_nobuiltin(1436; CHECK-SAME: float [[X:%.*]]) {1437; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 1) #[[ATTR4]]1438; CHECK-NEXT: ret float [[CALL]]1439;1440 %call = tail call float @_Z5rootnfi(float %x, i32 1) #01441 ret float %call1442}1443 1444define float @test_rootn_f32__y_2_nobuiltin(float %x) {1445; CHECK-LABEL: define float @test_rootn_f32__y_2_nobuiltin(1446; CHECK-SAME: float [[X:%.*]]) {1447; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 2) #[[ATTR4]]1448; CHECK-NEXT: ret float [[CALL]]1449;1450 %call = tail call float @_Z5rootnfi(float %x, i32 2) #01451 ret float %call1452}1453 1454define float @test_rootn_f32__y_3_nobuiltin(float %x) {1455; CHECK-LABEL: define float @test_rootn_f32__y_3_nobuiltin(1456; CHECK-SAME: float [[X:%.*]]) {1457; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 3) #[[ATTR4]]1458; CHECK-NEXT: ret float [[CALL]]1459;1460 %call = tail call float @_Z5rootnfi(float %x, i32 3) #01461 ret float %call1462}1463 1464define float @test_rootn_f32__y_neg1_nobuiltin(float %x) {1465; CHECK-LABEL: define float @test_rootn_f32__y_neg1_nobuiltin(1466; CHECK-SAME: float [[X:%.*]]) {1467; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 -1) #[[ATTR4]]1468; CHECK-NEXT: ret float [[CALL]]1469;1470 %call = tail call float @_Z5rootnfi(float %x, i32 -1) #01471 ret float %call1472}1473 1474define float @test_rootn_f32__y_neg2_nobuiltin(float %x) {1475; CHECK-LABEL: define float @test_rootn_f32__y_neg2_nobuiltin(1476; CHECK-SAME: float [[X:%.*]]) {1477; CHECK-NEXT: [[CALL:%.*]] = tail call float @_Z5rootnfi(float [[X]], i32 -2) #[[ATTR4]]1478; CHECK-NEXT: ret float [[CALL]]1479;1480 %call = tail call float @_Z5rootnfi(float %x, i32 -2) #01481 ret float %call1482}1483 1484attributes #0 = { nobuiltin }1485attributes #1 = { strictfp }1486attributes #2 = { noinline }1487 1488 1489!0 = !{float 3.0}1490;.1491; CHECK: attributes #[[ATTR0]] = { strictfp }1492; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }1493; CHECK: attributes #[[ATTR2:[0-9]+]] = { nounwind memory(read) }1494; CHECK: attributes #[[ATTR3]] = { noinline }1495; CHECK: attributes #[[ATTR4]] = { nobuiltin }1496;.1497; CHECK: [[META0]] = !{float 2.000000e+00}1498; CHECK: [[META1]] = !{float 3.000000e+00}1499;.1500