560 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 float @_Z3expf(float)5declare <2 x float> @_Z3expDv2_f(<2 x float>)6declare <3 x float> @_Z3expDv3_f(<3 x float>)7declare <4 x float> @_Z3expDv4_f(<4 x float>)8declare <8 x float> @_Z3expDv8_f(<8 x float>)9declare <16 x float> @_Z3expDv16_f(<16 x float>)10 11declare double @_Z3expd(double)12declare <2 x double> @_Z3expDv2_d(<2 x double>)13declare <3 x double> @_Z3expDv3_d(<3 x double>)14declare <4 x double> @_Z3expDv4_d(<4 x double>)15declare <8 x double> @_Z3expDv8_d(<8 x double>)16declare <16 x double> @_Z3expDv16_d(<16 x double>)17 18declare half @_Z3expDh(half)19declare <2 x half> @_Z3expDv2_Dh(<2 x half>)20declare <3 x half> @_Z3expDv3_Dh(<3 x half>)21declare <4 x half> @_Z3expDv4_Dh(<4 x half>)22declare <8 x half> @_Z3expDv8_Dh(<8 x half>)23declare <16 x half> @_Z3expDv16_Dh(<16 x half>)24 25define float @test_exp_f32(float %arg) {26; CHECK-LABEL: define float @test_exp_f3227; CHECK-SAME: (float [[ARG:%.*]]) {28; CHECK-NEXT: [[EXP:%.*]] = tail call float @_Z3expf(float [[ARG]]), !fpmath !029; CHECK-NEXT: ret float [[EXP]]30;31 %exp = tail call float @_Z3expf(float %arg), !fpmath !032 ret float %exp33}34 35define <2 x float> @test_exp_v2f32(<2 x float> %arg) {36; CHECK-LABEL: define <2 x float> @test_exp_v2f3237; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {38; CHECK-NEXT: [[EXP:%.*]] = tail call <2 x float> @_Z3expDv2_f(<2 x float> [[ARG]]), !fpmath !039; CHECK-NEXT: ret <2 x float> [[EXP]]40;41 %exp = tail call <2 x float> @_Z3expDv2_f(<2 x float> %arg), !fpmath !042 ret <2 x float> %exp43}44 45define <3 x float> @test_exp_v3f32(<3 x float> %arg) {46; CHECK-LABEL: define <3 x float> @test_exp_v3f3247; CHECK-SAME: (<3 x float> [[ARG:%.*]]) {48; CHECK-NEXT: [[EXP:%.*]] = tail call <3 x float> @_Z3expDv3_f(<3 x float> [[ARG]]), !fpmath !049; CHECK-NEXT: ret <3 x float> [[EXP]]50;51 %exp = tail call <3 x float> @_Z3expDv3_f(<3 x float> %arg), !fpmath !052 ret <3 x float> %exp53}54 55define <4 x float> @test_exp_v4f32(<4 x float> %arg) {56; CHECK-LABEL: define <4 x float> @test_exp_v4f3257; CHECK-SAME: (<4 x float> [[ARG:%.*]]) {58; CHECK-NEXT: [[EXP:%.*]] = tail call <4 x float> @_Z3expDv4_f(<4 x float> [[ARG]]), !fpmath !059; CHECK-NEXT: ret <4 x float> [[EXP]]60;61 %exp = tail call <4 x float> @_Z3expDv4_f(<4 x float> %arg), !fpmath !062 ret <4 x float> %exp63}64 65define <8 x float> @test_exp_v8f32(<8 x float> %arg) {66; CHECK-LABEL: define <8 x float> @test_exp_v8f3267; CHECK-SAME: (<8 x float> [[ARG:%.*]]) {68; CHECK-NEXT: [[EXP:%.*]] = tail call <8 x float> @_Z3expDv8_f(<8 x float> [[ARG]]), !fpmath !069; CHECK-NEXT: ret <8 x float> [[EXP]]70;71 %exp = tail call <8 x float> @_Z3expDv8_f(<8 x float> %arg), !fpmath !072 ret <8 x float> %exp73}74 75define <16 x float> @test_exp_v16f32(<16 x float> %arg) {76; CHECK-LABEL: define <16 x float> @test_exp_v16f3277; CHECK-SAME: (<16 x float> [[ARG:%.*]]) {78; CHECK-NEXT: [[EXP:%.*]] = tail call <16 x float> @_Z3expDv16_f(<16 x float> [[ARG]]), !fpmath !079; CHECK-NEXT: ret <16 x float> [[EXP]]80;81 %exp = tail call <16 x float> @_Z3expDv16_f(<16 x float> %arg), !fpmath !082 ret <16 x float> %exp83}84 85define float @test_exp_cr_f32(float %arg) {86; CHECK-LABEL: define float @test_exp_cr_f3287; CHECK-SAME: (float [[ARG:%.*]]) {88; CHECK-NEXT: [[EXP:%.*]] = tail call float @_Z3expf(float [[ARG]])89; CHECK-NEXT: ret float [[EXP]]90;91 %exp = tail call float @_Z3expf(float %arg)92 ret float %exp93}94 95define <2 x float> @test_exp_cr_v2f32(<2 x float> %arg) {96; CHECK-LABEL: define <2 x float> @test_exp_cr_v2f3297; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {98; CHECK-NEXT: [[EXP:%.*]] = tail call <2 x float> @_Z3expDv2_f(<2 x float> [[ARG]])99; CHECK-NEXT: ret <2 x float> [[EXP]]100;101 %exp = tail call <2 x float> @_Z3expDv2_f(<2 x float> %arg)102 ret <2 x float> %exp103}104 105define <3 x float> @test_exp_cr_v3f32(<3 x float> %arg) {106; CHECK-LABEL: define <3 x float> @test_exp_cr_v3f32107; CHECK-SAME: (<3 x float> [[ARG:%.*]]) {108; CHECK-NEXT: [[EXP:%.*]] = tail call <3 x float> @_Z3expDv3_f(<3 x float> [[ARG]])109; CHECK-NEXT: ret <3 x float> [[EXP]]110;111 %exp = tail call <3 x float> @_Z3expDv3_f(<3 x float> %arg)112 ret <3 x float> %exp113}114 115define <4 x float> @test_exp_cr_v4f32(<4 x float> %arg) {116; CHECK-LABEL: define <4 x float> @test_exp_cr_v4f32117; CHECK-SAME: (<4 x float> [[ARG:%.*]]) {118; CHECK-NEXT: [[EXP:%.*]] = tail call <4 x float> @_Z3expDv4_f(<4 x float> [[ARG]])119; CHECK-NEXT: ret <4 x float> [[EXP]]120;121 %exp = tail call <4 x float> @_Z3expDv4_f(<4 x float> %arg)122 ret <4 x float> %exp123}124 125define <8 x float> @test_exp_cr_v8f32(<8 x float> %arg) {126; CHECK-LABEL: define <8 x float> @test_exp_cr_v8f32127; CHECK-SAME: (<8 x float> [[ARG:%.*]]) {128; CHECK-NEXT: [[EXP:%.*]] = tail call <8 x float> @_Z3expDv8_f(<8 x float> [[ARG]])129; CHECK-NEXT: ret <8 x float> [[EXP]]130;131 %exp = tail call <8 x float> @_Z3expDv8_f(<8 x float> %arg)132 ret <8 x float> %exp133}134 135define <16 x float> @test_exp_cr_v16f32(<16 x float> %arg) {136; CHECK-LABEL: define <16 x float> @test_exp_cr_v16f32137; CHECK-SAME: (<16 x float> [[ARG:%.*]]) {138; CHECK-NEXT: [[EXP:%.*]] = tail call <16 x float> @_Z3expDv16_f(<16 x float> [[ARG]])139; CHECK-NEXT: ret <16 x float> [[EXP]]140;141 %exp = tail call <16 x float> @_Z3expDv16_f(<16 x float> %arg)142 ret <16 x float> %exp143}144 145define double @test_exp_f64(double %arg) {146; CHECK-LABEL: define double @test_exp_f64147; CHECK-SAME: (double [[ARG:%.*]]) {148; CHECK-NEXT: [[EXP:%.*]] = tail call double @_Z3expd(double [[ARG]])149; CHECK-NEXT: ret double [[EXP]]150;151 %exp = tail call double @_Z3expd(double %arg)152 ret double %exp153}154 155define <2 x double> @test_exp_v2f64(<2 x double> %arg) {156; CHECK-LABEL: define <2 x double> @test_exp_v2f64157; CHECK-SAME: (<2 x double> [[ARG:%.*]]) {158; CHECK-NEXT: [[EXP:%.*]] = tail call <2 x double> @_Z3expDv2_d(<2 x double> [[ARG]])159; CHECK-NEXT: ret <2 x double> [[EXP]]160;161 %exp = tail call <2 x double> @_Z3expDv2_d(<2 x double> %arg)162 ret <2 x double> %exp163}164 165define <3 x double> @test_exp_v3f64(<3 x double> %arg) {166; CHECK-LABEL: define <3 x double> @test_exp_v3f64167; CHECK-SAME: (<3 x double> [[ARG:%.*]]) {168; CHECK-NEXT: [[EXP:%.*]] = tail call <3 x double> @_Z3expDv3_d(<3 x double> [[ARG]])169; CHECK-NEXT: ret <3 x double> [[EXP]]170;171 %exp = tail call <3 x double> @_Z3expDv3_d(<3 x double> %arg)172 ret <3 x double> %exp173}174 175define <4 x double> @test_exp_v4f64(<4 x double> %arg) {176; CHECK-LABEL: define <4 x double> @test_exp_v4f64177; CHECK-SAME: (<4 x double> [[ARG:%.*]]) {178; CHECK-NEXT: [[EXP:%.*]] = tail call <4 x double> @_Z3expDv4_d(<4 x double> [[ARG]])179; CHECK-NEXT: ret <4 x double> [[EXP]]180;181 %exp = tail call <4 x double> @_Z3expDv4_d(<4 x double> %arg)182 ret <4 x double> %exp183}184 185define <8 x double> @test_exp_v8f64(<8 x double> %arg) {186; CHECK-LABEL: define <8 x double> @test_exp_v8f64187; CHECK-SAME: (<8 x double> [[ARG:%.*]]) {188; CHECK-NEXT: [[EXP:%.*]] = tail call <8 x double> @_Z3expDv8_d(<8 x double> [[ARG]])189; CHECK-NEXT: ret <8 x double> [[EXP]]190;191 %exp = tail call <8 x double> @_Z3expDv8_d(<8 x double> %arg)192 ret <8 x double> %exp193}194 195define <16 x double> @test_exp_v16f64(<16 x double> %arg) {196; CHECK-LABEL: define <16 x double> @test_exp_v16f64197; CHECK-SAME: (<16 x double> [[ARG:%.*]]) {198; CHECK-NEXT: [[EXP:%.*]] = tail call <16 x double> @_Z3expDv16_d(<16 x double> [[ARG]])199; CHECK-NEXT: ret <16 x double> [[EXP]]200;201 %exp = tail call <16 x double> @_Z3expDv16_d(<16 x double> %arg)202 ret <16 x double> %exp203}204 205define half @test_exp_f16(half %arg) {206; CHECK-LABEL: define half @test_exp_f16207; CHECK-SAME: (half [[ARG:%.*]]) {208; CHECK-NEXT: [[EXP:%.*]] = tail call half @_Z3expDh(half [[ARG]])209; CHECK-NEXT: ret half [[EXP]]210;211 %exp = tail call half @_Z3expDh(half %arg)212 ret half %exp213}214 215define half @test_exp_f16_fast(half %arg) {216; CHECK-LABEL: define half @test_exp_f16_fast217; CHECK-SAME: (half [[ARG:%.*]]) {218; CHECK-NEXT: [[EXP:%.*]] = tail call fast half @llvm.exp.f16(half [[ARG]])219; CHECK-NEXT: ret half [[EXP]]220;221 %exp = tail call fast half @_Z3expDh(half %arg)222 ret half %exp223}224 225define <2 x half> @test_exp_v2f16(<2 x half> %arg) {226; CHECK-LABEL: define <2 x half> @test_exp_v2f16227; CHECK-SAME: (<2 x half> [[ARG:%.*]]) {228; CHECK-NEXT: [[EXP:%.*]] = tail call <2 x half> @_Z3expDv2_Dh(<2 x half> [[ARG]])229; CHECK-NEXT: ret <2 x half> [[EXP]]230;231 %exp = tail call <2 x half> @_Z3expDv2_Dh(<2 x half> %arg)232 ret <2 x half> %exp233}234 235define <3 x half> @test_exp_v3f16(<3 x half> %arg) {236; CHECK-LABEL: define <3 x half> @test_exp_v3f16237; CHECK-SAME: (<3 x half> [[ARG:%.*]]) {238; CHECK-NEXT: [[EXP:%.*]] = tail call <3 x half> @_Z3expDv3_Dh(<3 x half> [[ARG]])239; CHECK-NEXT: ret <3 x half> [[EXP]]240;241 %exp = tail call <3 x half> @_Z3expDv3_Dh(<3 x half> %arg)242 ret <3 x half> %exp243}244 245define <4 x half> @test_exp_v4f16(<4 x half> %arg) {246; CHECK-LABEL: define <4 x half> @test_exp_v4f16247; CHECK-SAME: (<4 x half> [[ARG:%.*]]) {248; CHECK-NEXT: [[EXP:%.*]] = tail call <4 x half> @_Z3expDv4_Dh(<4 x half> [[ARG]])249; CHECK-NEXT: ret <4 x half> [[EXP]]250;251 %exp = tail call <4 x half> @_Z3expDv4_Dh(<4 x half> %arg)252 ret <4 x half> %exp253}254 255define <8 x half> @test_exp_v8f16(<8 x half> %arg) {256; CHECK-LABEL: define <8 x half> @test_exp_v8f16257; CHECK-SAME: (<8 x half> [[ARG:%.*]]) {258; CHECK-NEXT: [[EXP:%.*]] = tail call <8 x half> @_Z3expDv8_Dh(<8 x half> [[ARG]])259; CHECK-NEXT: ret <8 x half> [[EXP]]260;261 %exp = tail call <8 x half> @_Z3expDv8_Dh(<8 x half> %arg)262 ret <8 x half> %exp263}264 265define <16 x half> @test_exp_v16f16(<16 x half> %arg) {266; CHECK-LABEL: define <16 x half> @test_exp_v16f16267; CHECK-SAME: (<16 x half> [[ARG:%.*]]) {268; CHECK-NEXT: [[EXP:%.*]] = tail call <16 x half> @_Z3expDv16_Dh(<16 x half> [[ARG]])269; CHECK-NEXT: ret <16 x half> [[EXP]]270;271 %exp = tail call <16 x half> @_Z3expDv16_Dh(<16 x half> %arg)272 ret <16 x half> %exp273}274 275define float @test_exp_f32_nobuiltin_callsite(float %arg) {276; CHECK-LABEL: define float @test_exp_f32_nobuiltin_callsite277; CHECK-SAME: (float [[ARG:%.*]]) {278; CHECK-NEXT: [[EXP:%.*]] = tail call float @_Z3expf(float [[ARG]]) #[[ATTR6:[0-9]+]], !fpmath !0279; CHECK-NEXT: ret float [[EXP]]280;281 %exp = tail call float @_Z3expf(float %arg) #0, !fpmath !0282 ret float %exp283}284 285define <2 x float> @test_exp_v2f32_nobuiltin_callsite(<2 x float> %arg) {286; CHECK-LABEL: define <2 x float> @test_exp_v2f32_nobuiltin_callsite287; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {288; CHECK-NEXT: [[EXP:%.*]] = tail call <2 x float> @_Z3expDv2_f(<2 x float> [[ARG]]) #[[ATTR6]], !fpmath !0289; CHECK-NEXT: ret <2 x float> [[EXP]]290;291 %exp = tail call <2 x float> @_Z3expDv2_f(<2 x float> %arg) #0, !fpmath !0292 ret <2 x float> %exp293}294 295define float @test_exp_cr_f32_nobuiltin_callsite(float %arg) {296; CHECK-LABEL: define float @test_exp_cr_f32_nobuiltin_callsite297; CHECK-SAME: (float [[ARG:%.*]]) {298; CHECK-NEXT: [[EXP:%.*]] = tail call float @_Z3expf(float [[ARG]]) #[[ATTR6]]299; CHECK-NEXT: ret float [[EXP]]300;301 %exp = tail call float @_Z3expf(float %arg) #0302 ret float %exp303}304 305define <2 x float> @test_exp_cr_v2f32_nobuiltin_callsite(<2 x float> %arg) {306; CHECK-LABEL: define <2 x float> @test_exp_cr_v2f32_nobuiltin_callsite307; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {308; CHECK-NEXT: [[EXP:%.*]] = tail call <2 x float> @_Z3expDv2_f(<2 x float> [[ARG]]) #[[ATTR6]]309; CHECK-NEXT: ret <2 x float> [[EXP]]310;311 %exp = tail call <2 x float> @_Z3expDv2_f(<2 x float> %arg) #0312 ret <2 x float> %exp313}314 315; "no-builtins" should be ignored316define float @test_exp_f32_nobuiltins(float %arg) #1 {317; CHECK-LABEL: define float @test_exp_f32_nobuiltins318; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR0:[0-9]+]] {319; CHECK-NEXT: [[EXP:%.*]] = tail call float @_Z3expf(float [[ARG]]) #[[ATTR6]], !fpmath !0320; CHECK-NEXT: ret float [[EXP]]321;322 %exp = tail call float @_Z3expf(float %arg) #0, !fpmath !0323 ret float %exp324}325 326define <2 x float> @test_exp_v2f32_nobuiltins(<2 x float> %arg) #1 {327; CHECK-LABEL: define <2 x float> @test_exp_v2f32_nobuiltins328; CHECK-SAME: (<2 x float> [[ARG:%.*]]) #[[ATTR0]] {329; CHECK-NEXT: [[EXP:%.*]] = tail call <2 x float> @_Z3expDv2_f(<2 x float> [[ARG]]) #[[ATTR6]], !fpmath !0330; CHECK-NEXT: ret <2 x float> [[EXP]]331;332 %exp = tail call <2 x float> @_Z3expDv2_f(<2 x float> %arg) #0, !fpmath !0333 ret <2 x float> %exp334}335 336define float @test_exp_cr_f32_nobuiltins(float %arg) #1 {337; CHECK-LABEL: define float @test_exp_cr_f32_nobuiltins338; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR0]] {339; CHECK-NEXT: [[EXP:%.*]] = tail call float @_Z3expf(float [[ARG]]) #[[ATTR6]]340; CHECK-NEXT: ret float [[EXP]]341;342 %exp = tail call float @_Z3expf(float %arg) #0343 ret float %exp344}345 346define <2 x float> @test_exp_cr_v2f32_nobuiltins(<2 x float> %arg) #1 {347; CHECK-LABEL: define <2 x float> @test_exp_cr_v2f32_nobuiltins348; CHECK-SAME: (<2 x float> [[ARG:%.*]]) #[[ATTR0]] {349; CHECK-NEXT: [[EXP:%.*]] = tail call <2 x float> @_Z3expDv2_f(<2 x float> [[ARG]]) #[[ATTR6]]350; CHECK-NEXT: ret <2 x float> [[EXP]]351;352 %exp = tail call <2 x float> @_Z3expDv2_f(<2 x float> %arg) #0353 ret <2 x float> %exp354}355 356define float @test_exp_f32_preserve_flags(float %arg) {357; CHECK-LABEL: define float @test_exp_f32_preserve_flags358; CHECK-SAME: (float [[ARG:%.*]]) {359; CHECK-NEXT: [[EXP:%.*]] = tail call nnan ninf float @llvm.exp.f32(float [[ARG]]), !fpmath !0360; CHECK-NEXT: ret float [[EXP]]361;362 %exp = tail call nnan ninf float @_Z3expf(float %arg), !fpmath !0363 ret float %exp364}365 366define <2 x float> @test_exp_v2f32_preserve_flags(<2 x float> %arg) {367; CHECK-LABEL: define <2 x float> @test_exp_v2f32_preserve_flags368; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {369; CHECK-NEXT: [[EXP:%.*]] = tail call nnan nsz contract <2 x float> @llvm.exp.v2f32(<2 x float> [[ARG]]), !fpmath !0370; CHECK-NEXT: ret <2 x float> [[EXP]]371;372 %exp = tail call contract nsz nnan <2 x float> @_Z3expDv2_f(<2 x float> %arg), !fpmath !0373 ret <2 x float> %exp374}375 376define float @test_exp_f32_preserve_flags_md(float %arg) {377; CHECK-LABEL: define float @test_exp_f32_preserve_flags_md378; CHECK-SAME: (float [[ARG:%.*]]) {379; CHECK-NEXT: [[EXP:%.*]] = tail call nnan ninf float @llvm.exp.f32(float [[ARG]]), !fpmath !0, !foo !1380; CHECK-NEXT: ret float [[EXP]]381;382 %exp = tail call nnan ninf float @_Z3expf(float %arg), !fpmath !0, !foo !1383 ret float %exp384}385 386define <2 x float> @test_exp_v2f32_preserve_flags_md(<2 x float> %arg) {387; CHECK-LABEL: define <2 x float> @test_exp_v2f32_preserve_flags_md388; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {389; CHECK-NEXT: [[EXP:%.*]] = tail call nnan nsz contract <2 x float> @llvm.exp.v2f32(<2 x float> [[ARG]]), !fpmath !0, !foo !1390; CHECK-NEXT: ret <2 x float> [[EXP]]391;392 %exp = tail call contract nsz nnan <2 x float> @_Z3expDv2_f(<2 x float> %arg), !fpmath !0, !foo !1393 ret <2 x float> %exp394}395 396define float @test_exp_cr_f32_preserve_flags(float %arg) {397; CHECK-LABEL: define float @test_exp_cr_f32_preserve_flags398; CHECK-SAME: (float [[ARG:%.*]]) {399; CHECK-NEXT: [[EXP:%.*]] = tail call ninf contract float @llvm.exp.f32(float [[ARG]])400; CHECK-NEXT: ret float [[EXP]]401;402 %exp = tail call ninf contract float @_Z3expf(float %arg)403 ret float %exp404}405 406define <2 x float> @test_exp_cr_v2f32_preserve_flags(<2 x float> %arg) {407; CHECK-LABEL: define <2 x float> @test_exp_cr_v2f32_preserve_flags408; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {409; CHECK-NEXT: [[EXP:%.*]] = tail call nnan nsz <2 x float> @llvm.exp.v2f32(<2 x float> [[ARG]])410; CHECK-NEXT: ret <2 x float> [[EXP]]411;412 %exp = tail call nnan nsz <2 x float> @_Z3expDv2_f(<2 x float> %arg)413 ret <2 x float> %exp414}415 416; Test the libm name, not a recognized opencl builtin.417declare float @expf(float) #2418declare double @exp(double) #2419 420define float @test_libm_exp_f32(float %arg) {421; CHECK-LABEL: define float @test_libm_exp_f32422; CHECK-SAME: (float [[ARG:%.*]]) {423; CHECK-NEXT: [[EXP:%.*]] = tail call float @expf(float [[ARG]])424; CHECK-NEXT: ret float [[EXP]]425;426 %exp = tail call float @expf(float %arg)427 ret float %exp428}429 430define float @test_libm_exp_f32_fast(float %arg) {431; CHECK-LABEL: define float @test_libm_exp_f32_fast432; CHECK-SAME: (float [[ARG:%.*]]) {433; CHECK-NEXT: [[EXP:%.*]] = tail call fast float @expf(float [[ARG]])434; CHECK-NEXT: ret float [[EXP]]435;436 %exp = tail call fast float @expf(float %arg)437 ret float %exp438}439 440define float @test_libm_exp_f32_fpmath(float %arg) {441; CHECK-LABEL: define float @test_libm_exp_f32_fpmath442; CHECK-SAME: (float [[ARG:%.*]]) {443; CHECK-NEXT: [[EXP:%.*]] = tail call float @expf(float [[ARG]]), !fpmath !0444; CHECK-NEXT: ret float [[EXP]]445;446 %exp = tail call float @expf(float %arg), !fpmath !0447 ret float %exp448}449 450define double @test_libm_exp_f64(double %arg) {451; CHECK-LABEL: define double @test_libm_exp_f64452; CHECK-SAME: (double [[ARG:%.*]]) {453; CHECK-NEXT: [[EXP:%.*]] = tail call double @exp(double [[ARG]])454; CHECK-NEXT: ret double [[EXP]]455;456 %exp = tail call double @exp(double %arg)457 ret double %exp458}459 460define double @test_libm_exp_f64_fast(double %arg) {461; CHECK-LABEL: define double @test_libm_exp_f64_fast462; CHECK-SAME: (double [[ARG:%.*]]) {463; CHECK-NEXT: [[EXP:%.*]] = tail call fast double @exp(double [[ARG]])464; CHECK-NEXT: ret double [[EXP]]465;466 %exp = tail call fast double @exp(double %arg)467 ret double %exp468}469 470define double @test_libm_exp_f64_fpmath(double %arg) {471; CHECK-LABEL: define double @test_libm_exp_f64_fpmath472; CHECK-SAME: (double [[ARG:%.*]]) {473; CHECK-NEXT: [[EXP:%.*]] = tail call double @exp(double [[ARG]]), !fpmath !0474; CHECK-NEXT: ret double [[EXP]]475;476 %exp = tail call double @exp(double %arg), !fpmath !0477 ret double %exp478}479 480define float @test_exp_f32_fast_noinline(float %arg) {481; CHECK-LABEL: define float @test_exp_f32_fast_noinline482; CHECK-SAME: (float [[ARG:%.*]]) {483; CHECK-NEXT: [[EXP:%.*]] = tail call fast float @_Z3expf(float [[ARG]]) #[[ATTR7:[0-9]+]], !fpmath !0484; CHECK-NEXT: ret float [[EXP]]485;486 %exp = tail call fast float @_Z3expf(float %arg) #3, !fpmath !0487 ret float %exp488}489 490define float @test_exp_f32_fast_optsize(float %arg) #4 {491; CHECK-LABEL: define float @test_exp_f32_fast_optsize492; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR2:[0-9]+]] {493; CHECK-NEXT: [[EXP:%.*]] = tail call fast float @llvm.exp.f32(float [[ARG]]), !fpmath !0494; CHECK-NEXT: ret float [[EXP]]495;496 %exp = tail call fast float @_Z3expf(float %arg), !fpmath !0497 ret float %exp498}499 500define float @test_exp_f32_fast_minsize(float %arg) #5 {501; CHECK-LABEL: define float @test_exp_f32_fast_minsize502; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR3:[0-9]+]] {503; CHECK-NEXT: [[EXP:%.*]] = tail call fast float @llvm.exp.f32(float [[ARG]]), !fpmath !0504; CHECK-NEXT: ret float [[EXP]]505;506 %exp = tail call fast float @_Z3expf(float %arg), !fpmath !0507 ret float %exp508}509 510define float @test_exp_f32_nsz_contract_optsize(float %arg) #4 {511; CHECK-LABEL: define float @test_exp_f32_nsz_contract_optsize512; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR2]] {513; CHECK-NEXT: [[EXP:%.*]] = tail call nsz contract float @llvm.exp.f32(float [[ARG]]), !fpmath !0514; CHECK-NEXT: ret float [[EXP]]515;516 %exp = tail call nsz contract float @_Z3expf(float %arg), !fpmath !0517 ret float %exp518}519 520define float @test_exp_f32_nsz_contract_minsize(float %arg) #5 {521; CHECK-LABEL: define float @test_exp_f32_nsz_contract_minsize522; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR3]] {523; CHECK-NEXT: [[EXP:%.*]] = tail call nsz contract float @_Z3expf(float [[ARG]]), !fpmath !0524; CHECK-NEXT: ret float [[EXP]]525;526 %exp = tail call nsz contract float @_Z3expf(float %arg), !fpmath !0527 ret float %exp528}529 530define half @test_exp_f16_fast_minsize(half %arg) #5 {531; CHECK-LABEL: define half @test_exp_f16_fast_minsize532; CHECK-SAME: (half [[ARG:%.*]]) #[[ATTR3]] {533; CHECK-NEXT: [[EXP:%.*]] = tail call half @_Z3expDh(half [[ARG]])534; CHECK-NEXT: ret half [[EXP]]535;536 %exp = tail call half @_Z3expDh(half %arg)537 ret half %exp538}539 540define float @test_exp_f32_strictfp(float %arg) #6 {541; CHECK-LABEL: define float @test_exp_f32_strictfp542; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR4:[0-9]+]] {543; CHECK-NEXT: [[EXP:%.*]] = tail call nsz float @_Z3expf(float [[ARG]]) #[[ATTR4]]544; CHECK-NEXT: ret float [[EXP]]545;546 %exp = tail call nsz float @_Z3expf(float %arg) #6547 ret float %exp548}549 550attributes #0 = { nobuiltin }551attributes #1 = { "no-builtins" }552attributes #2 = { nounwind memory(none) }553attributes #3 = { noinline }554attributes #4 = { optsize }555attributes #5 = { minsize }556attributes #6 = { strictfp }557 558!0 = !{float 3.000000e+00}559!1 = !{i32 1234}560