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 @_Z3logf(float)5declare <2 x float> @_Z3logDv2_f(<2 x float>)6declare <3 x float> @_Z3logDv3_f(<3 x float>)7declare <4 x float> @_Z3logDv4_f(<4 x float>)8declare <8 x float> @_Z3logDv8_f(<8 x float>)9declare <16 x float> @_Z3logDv16_f(<16 x float>)10 11declare double @_Z3logd(double)12declare <2 x double> @_Z3logDv2_d(<2 x double>)13declare <3 x double> @_Z3logDv3_d(<3 x double>)14declare <4 x double> @_Z3logDv4_d(<4 x double>)15declare <8 x double> @_Z3logDv8_d(<8 x double>)16declare <16 x double> @_Z3logDv16_d(<16 x double>)17 18declare half @_Z3logDh(half)19declare <2 x half> @_Z3logDv2_Dh(<2 x half>)20declare <3 x half> @_Z3logDv3_Dh(<3 x half>)21declare <4 x half> @_Z3logDv4_Dh(<4 x half>)22declare <8 x half> @_Z3logDv8_Dh(<8 x half>)23declare <16 x half> @_Z3logDv16_Dh(<16 x half>)24 25define float @test_log_f32(float %arg) {26; CHECK-LABEL: define float @test_log_f3227; CHECK-SAME: (float [[ARG:%.*]]) {28; CHECK-NEXT: [[LOG:%.*]] = tail call float @_Z3logf(float [[ARG]]), !fpmath !029; CHECK-NEXT: ret float [[LOG]]30;31 %log = tail call float @_Z3logf(float %arg), !fpmath !032 ret float %log33}34 35define <2 x float> @test_log_v2f32(<2 x float> %arg) {36; CHECK-LABEL: define <2 x float> @test_log_v2f3237; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {38; CHECK-NEXT: [[LOG:%.*]] = tail call <2 x float> @_Z3logDv2_f(<2 x float> [[ARG]]), !fpmath !039; CHECK-NEXT: ret <2 x float> [[LOG]]40;41 %log = tail call <2 x float> @_Z3logDv2_f(<2 x float> %arg), !fpmath !042 ret <2 x float> %log43}44 45define <3 x float> @test_log_v3f32(<3 x float> %arg) {46; CHECK-LABEL: define <3 x float> @test_log_v3f3247; CHECK-SAME: (<3 x float> [[ARG:%.*]]) {48; CHECK-NEXT: [[LOG:%.*]] = tail call <3 x float> @_Z3logDv3_f(<3 x float> [[ARG]]), !fpmath !049; CHECK-NEXT: ret <3 x float> [[LOG]]50;51 %log = tail call <3 x float> @_Z3logDv3_f(<3 x float> %arg), !fpmath !052 ret <3 x float> %log53}54 55define <4 x float> @test_log_v4f32(<4 x float> %arg) {56; CHECK-LABEL: define <4 x float> @test_log_v4f3257; CHECK-SAME: (<4 x float> [[ARG:%.*]]) {58; CHECK-NEXT: [[LOG:%.*]] = tail call <4 x float> @_Z3logDv4_f(<4 x float> [[ARG]]), !fpmath !059; CHECK-NEXT: ret <4 x float> [[LOG]]60;61 %log = tail call <4 x float> @_Z3logDv4_f(<4 x float> %arg), !fpmath !062 ret <4 x float> %log63}64 65define <8 x float> @test_log_v8f32(<8 x float> %arg) {66; CHECK-LABEL: define <8 x float> @test_log_v8f3267; CHECK-SAME: (<8 x float> [[ARG:%.*]]) {68; CHECK-NEXT: [[LOG:%.*]] = tail call <8 x float> @_Z3logDv8_f(<8 x float> [[ARG]]), !fpmath !069; CHECK-NEXT: ret <8 x float> [[LOG]]70;71 %log = tail call <8 x float> @_Z3logDv8_f(<8 x float> %arg), !fpmath !072 ret <8 x float> %log73}74 75define <16 x float> @test_log_v16f32(<16 x float> %arg) {76; CHECK-LABEL: define <16 x float> @test_log_v16f3277; CHECK-SAME: (<16 x float> [[ARG:%.*]]) {78; CHECK-NEXT: [[LOG:%.*]] = tail call <16 x float> @_Z3logDv16_f(<16 x float> [[ARG]]), !fpmath !079; CHECK-NEXT: ret <16 x float> [[LOG]]80;81 %log = tail call <16 x float> @_Z3logDv16_f(<16 x float> %arg), !fpmath !082 ret <16 x float> %log83}84 85define float @test_log_cr_f32(float %arg) {86; CHECK-LABEL: define float @test_log_cr_f3287; CHECK-SAME: (float [[ARG:%.*]]) {88; CHECK-NEXT: [[LOG:%.*]] = tail call float @_Z3logf(float [[ARG]])89; CHECK-NEXT: ret float [[LOG]]90;91 %log = tail call float @_Z3logf(float %arg)92 ret float %log93}94 95define <2 x float> @test_log_cr_v2f32(<2 x float> %arg) {96; CHECK-LABEL: define <2 x float> @test_log_cr_v2f3297; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {98; CHECK-NEXT: [[LOG:%.*]] = tail call <2 x float> @_Z3logDv2_f(<2 x float> [[ARG]])99; CHECK-NEXT: ret <2 x float> [[LOG]]100;101 %log = tail call <2 x float> @_Z3logDv2_f(<2 x float> %arg)102 ret <2 x float> %log103}104 105define <3 x float> @test_log_cr_v3f32(<3 x float> %arg) {106; CHECK-LABEL: define <3 x float> @test_log_cr_v3f32107; CHECK-SAME: (<3 x float> [[ARG:%.*]]) {108; CHECK-NEXT: [[LOG:%.*]] = tail call <3 x float> @_Z3logDv3_f(<3 x float> [[ARG]])109; CHECK-NEXT: ret <3 x float> [[LOG]]110;111 %log = tail call <3 x float> @_Z3logDv3_f(<3 x float> %arg)112 ret <3 x float> %log113}114 115define <4 x float> @test_log_cr_v4f32(<4 x float> %arg) {116; CHECK-LABEL: define <4 x float> @test_log_cr_v4f32117; CHECK-SAME: (<4 x float> [[ARG:%.*]]) {118; CHECK-NEXT: [[LOG:%.*]] = tail call <4 x float> @_Z3logDv4_f(<4 x float> [[ARG]])119; CHECK-NEXT: ret <4 x float> [[LOG]]120;121 %log = tail call <4 x float> @_Z3logDv4_f(<4 x float> %arg)122 ret <4 x float> %log123}124 125define <8 x float> @test_log_cr_v8f32(<8 x float> %arg) {126; CHECK-LABEL: define <8 x float> @test_log_cr_v8f32127; CHECK-SAME: (<8 x float> [[ARG:%.*]]) {128; CHECK-NEXT: [[LOG:%.*]] = tail call <8 x float> @_Z3logDv8_f(<8 x float> [[ARG]])129; CHECK-NEXT: ret <8 x float> [[LOG]]130;131 %log = tail call <8 x float> @_Z3logDv8_f(<8 x float> %arg)132 ret <8 x float> %log133}134 135define <16 x float> @test_log_cr_v16f32(<16 x float> %arg) {136; CHECK-LABEL: define <16 x float> @test_log_cr_v16f32137; CHECK-SAME: (<16 x float> [[ARG:%.*]]) {138; CHECK-NEXT: [[LOG:%.*]] = tail call <16 x float> @_Z3logDv16_f(<16 x float> [[ARG]])139; CHECK-NEXT: ret <16 x float> [[LOG]]140;141 %log = tail call <16 x float> @_Z3logDv16_f(<16 x float> %arg)142 ret <16 x float> %log143}144 145define double @test_log_f64(double %arg) {146; CHECK-LABEL: define double @test_log_f64147; CHECK-SAME: (double [[ARG:%.*]]) {148; CHECK-NEXT: [[LOG:%.*]] = tail call double @_Z3logd(double [[ARG]])149; CHECK-NEXT: ret double [[LOG]]150;151 %log = tail call double @_Z3logd(double %arg)152 ret double %log153}154 155define <2 x double> @test_log_v2f64(<2 x double> %arg) {156; CHECK-LABEL: define <2 x double> @test_log_v2f64157; CHECK-SAME: (<2 x double> [[ARG:%.*]]) {158; CHECK-NEXT: [[LOG:%.*]] = tail call <2 x double> @_Z3logDv2_d(<2 x double> [[ARG]])159; CHECK-NEXT: ret <2 x double> [[LOG]]160;161 %log = tail call <2 x double> @_Z3logDv2_d(<2 x double> %arg)162 ret <2 x double> %log163}164 165define <3 x double> @test_log_v3f64(<3 x double> %arg) {166; CHECK-LABEL: define <3 x double> @test_log_v3f64167; CHECK-SAME: (<3 x double> [[ARG:%.*]]) {168; CHECK-NEXT: [[LOG:%.*]] = tail call <3 x double> @_Z3logDv3_d(<3 x double> [[ARG]])169; CHECK-NEXT: ret <3 x double> [[LOG]]170;171 %log = tail call <3 x double> @_Z3logDv3_d(<3 x double> %arg)172 ret <3 x double> %log173}174 175define <4 x double> @test_log_v4f64(<4 x double> %arg) {176; CHECK-LABEL: define <4 x double> @test_log_v4f64177; CHECK-SAME: (<4 x double> [[ARG:%.*]]) {178; CHECK-NEXT: [[LOG:%.*]] = tail call <4 x double> @_Z3logDv4_d(<4 x double> [[ARG]])179; CHECK-NEXT: ret <4 x double> [[LOG]]180;181 %log = tail call <4 x double> @_Z3logDv4_d(<4 x double> %arg)182 ret <4 x double> %log183}184 185define <8 x double> @test_log_v8f64(<8 x double> %arg) {186; CHECK-LABEL: define <8 x double> @test_log_v8f64187; CHECK-SAME: (<8 x double> [[ARG:%.*]]) {188; CHECK-NEXT: [[LOG:%.*]] = tail call <8 x double> @_Z3logDv8_d(<8 x double> [[ARG]])189; CHECK-NEXT: ret <8 x double> [[LOG]]190;191 %log = tail call <8 x double> @_Z3logDv8_d(<8 x double> %arg)192 ret <8 x double> %log193}194 195define <16 x double> @test_log_v16f64(<16 x double> %arg) {196; CHECK-LABEL: define <16 x double> @test_log_v16f64197; CHECK-SAME: (<16 x double> [[ARG:%.*]]) {198; CHECK-NEXT: [[LOG:%.*]] = tail call <16 x double> @_Z3logDv16_d(<16 x double> [[ARG]])199; CHECK-NEXT: ret <16 x double> [[LOG]]200;201 %log = tail call <16 x double> @_Z3logDv16_d(<16 x double> %arg)202 ret <16 x double> %log203}204 205define half @test_log_f16(half %arg) {206; CHECK-LABEL: define half @test_log_f16207; CHECK-SAME: (half [[ARG:%.*]]) {208; CHECK-NEXT: [[LOG:%.*]] = tail call half @_Z3logDh(half [[ARG]])209; CHECK-NEXT: ret half [[LOG]]210;211 %log = tail call half @_Z3logDh(half %arg)212 ret half %log213}214 215define half @test_log_f16_fast(half %arg) {216; CHECK-LABEL: define half @test_log_f16_fast217; CHECK-SAME: (half [[ARG:%.*]]) {218; CHECK-NEXT: [[LOG:%.*]] = tail call fast half @llvm.log.f16(half [[ARG]])219; CHECK-NEXT: ret half [[LOG]]220;221 %log = tail call fast half @_Z3logDh(half %arg)222 ret half %log223}224 225define <2 x half> @test_log_v2f16(<2 x half> %arg) {226; CHECK-LABEL: define <2 x half> @test_log_v2f16227; CHECK-SAME: (<2 x half> [[ARG:%.*]]) {228; CHECK-NEXT: [[LOG:%.*]] = tail call <2 x half> @_Z3logDv2_Dh(<2 x half> [[ARG]])229; CHECK-NEXT: ret <2 x half> [[LOG]]230;231 %log = tail call <2 x half> @_Z3logDv2_Dh(<2 x half> %arg)232 ret <2 x half> %log233}234 235define <3 x half> @test_log_v3f16(<3 x half> %arg) {236; CHECK-LABEL: define <3 x half> @test_log_v3f16237; CHECK-SAME: (<3 x half> [[ARG:%.*]]) {238; CHECK-NEXT: [[LOG:%.*]] = tail call <3 x half> @_Z3logDv3_Dh(<3 x half> [[ARG]])239; CHECK-NEXT: ret <3 x half> [[LOG]]240;241 %log = tail call <3 x half> @_Z3logDv3_Dh(<3 x half> %arg)242 ret <3 x half> %log243}244 245define <4 x half> @test_log_v4f16(<4 x half> %arg) {246; CHECK-LABEL: define <4 x half> @test_log_v4f16247; CHECK-SAME: (<4 x half> [[ARG:%.*]]) {248; CHECK-NEXT: [[LOG:%.*]] = tail call <4 x half> @_Z3logDv4_Dh(<4 x half> [[ARG]])249; CHECK-NEXT: ret <4 x half> [[LOG]]250;251 %log = tail call <4 x half> @_Z3logDv4_Dh(<4 x half> %arg)252 ret <4 x half> %log253}254 255define <8 x half> @test_log_v8f16(<8 x half> %arg) {256; CHECK-LABEL: define <8 x half> @test_log_v8f16257; CHECK-SAME: (<8 x half> [[ARG:%.*]]) {258; CHECK-NEXT: [[LOG:%.*]] = tail call <8 x half> @_Z3logDv8_Dh(<8 x half> [[ARG]])259; CHECK-NEXT: ret <8 x half> [[LOG]]260;261 %log = tail call <8 x half> @_Z3logDv8_Dh(<8 x half> %arg)262 ret <8 x half> %log263}264 265define <16 x half> @test_log_v16f16(<16 x half> %arg) {266; CHECK-LABEL: define <16 x half> @test_log_v16f16267; CHECK-SAME: (<16 x half> [[ARG:%.*]]) {268; CHECK-NEXT: [[LOG:%.*]] = tail call <16 x half> @_Z3logDv16_Dh(<16 x half> [[ARG]])269; CHECK-NEXT: ret <16 x half> [[LOG]]270;271 %log = tail call <16 x half> @_Z3logDv16_Dh(<16 x half> %arg)272 ret <16 x half> %log273}274 275define float @test_log_f32_nobuiltin_callsite(float %arg) {276; CHECK-LABEL: define float @test_log_f32_nobuiltin_callsite277; CHECK-SAME: (float [[ARG:%.*]]) {278; CHECK-NEXT: [[LOG:%.*]] = tail call float @_Z3logf(float [[ARG]]) #[[ATTR6:[0-9]+]], !fpmath !0279; CHECK-NEXT: ret float [[LOG]]280;281 %log = tail call float @_Z3logf(float %arg) #0, !fpmath !0282 ret float %log283}284 285define <2 x float> @test_log_v2f32_nobuiltin_callsite(<2 x float> %arg) {286; CHECK-LABEL: define <2 x float> @test_log_v2f32_nobuiltin_callsite287; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {288; CHECK-NEXT: [[LOG:%.*]] = tail call <2 x float> @_Z3logDv2_f(<2 x float> [[ARG]]) #[[ATTR6]], !fpmath !0289; CHECK-NEXT: ret <2 x float> [[LOG]]290;291 %log = tail call <2 x float> @_Z3logDv2_f(<2 x float> %arg) #0, !fpmath !0292 ret <2 x float> %log293}294 295define float @test_log_cr_f32_nobuiltin_callsite(float %arg) {296; CHECK-LABEL: define float @test_log_cr_f32_nobuiltin_callsite297; CHECK-SAME: (float [[ARG:%.*]]) {298; CHECK-NEXT: [[LOG:%.*]] = tail call float @_Z3logf(float [[ARG]]) #[[ATTR6]]299; CHECK-NEXT: ret float [[LOG]]300;301 %log = tail call float @_Z3logf(float %arg) #0302 ret float %log303}304 305define <2 x float> @test_log_cr_v2f32_nobuiltin_callsite(<2 x float> %arg) {306; CHECK-LABEL: define <2 x float> @test_log_cr_v2f32_nobuiltin_callsite307; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {308; CHECK-NEXT: [[LOG:%.*]] = tail call <2 x float> @_Z3logDv2_f(<2 x float> [[ARG]]) #[[ATTR6]]309; CHECK-NEXT: ret <2 x float> [[LOG]]310;311 %log = tail call <2 x float> @_Z3logDv2_f(<2 x float> %arg) #0312 ret <2 x float> %log313}314 315; "no-builtins" should be ignored316define float @test_log_f32_nobuiltins(float %arg) #1 {317; CHECK-LABEL: define float @test_log_f32_nobuiltins318; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR0:[0-9]+]] {319; CHECK-NEXT: [[LOG:%.*]] = tail call float @_Z3logf(float [[ARG]]) #[[ATTR6]], !fpmath !0320; CHECK-NEXT: ret float [[LOG]]321;322 %log = tail call float @_Z3logf(float %arg) #0, !fpmath !0323 ret float %log324}325 326define <2 x float> @test_log_v2f32_nobuiltins(<2 x float> %arg) #1 {327; CHECK-LABEL: define <2 x float> @test_log_v2f32_nobuiltins328; CHECK-SAME: (<2 x float> [[ARG:%.*]]) #[[ATTR0]] {329; CHECK-NEXT: [[LOG:%.*]] = tail call <2 x float> @_Z3logDv2_f(<2 x float> [[ARG]]) #[[ATTR6]], !fpmath !0330; CHECK-NEXT: ret <2 x float> [[LOG]]331;332 %log = tail call <2 x float> @_Z3logDv2_f(<2 x float> %arg) #0, !fpmath !0333 ret <2 x float> %log334}335 336define float @test_log_cr_f32_nobuiltins(float %arg) #1 {337; CHECK-LABEL: define float @test_log_cr_f32_nobuiltins338; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR0]] {339; CHECK-NEXT: [[LOG:%.*]] = tail call float @_Z3logf(float [[ARG]]) #[[ATTR6]]340; CHECK-NEXT: ret float [[LOG]]341;342 %log = tail call float @_Z3logf(float %arg) #0343 ret float %log344}345 346define <2 x float> @test_log_cr_v2f32_nobuiltins(<2 x float> %arg) #1 {347; CHECK-LABEL: define <2 x float> @test_log_cr_v2f32_nobuiltins348; CHECK-SAME: (<2 x float> [[ARG:%.*]]) #[[ATTR0]] {349; CHECK-NEXT: [[LOG:%.*]] = tail call <2 x float> @_Z3logDv2_f(<2 x float> [[ARG]]) #[[ATTR6]]350; CHECK-NEXT: ret <2 x float> [[LOG]]351;352 %log = tail call <2 x float> @_Z3logDv2_f(<2 x float> %arg) #0353 ret <2 x float> %log354}355 356define float @test_log_f32_preserve_flags(float %arg) {357; CHECK-LABEL: define float @test_log_f32_preserve_flags358; CHECK-SAME: (float [[ARG:%.*]]) {359; CHECK-NEXT: [[LOG:%.*]] = tail call nnan ninf float @llvm.log.f32(float [[ARG]]), !fpmath !0360; CHECK-NEXT: ret float [[LOG]]361;362 %log = tail call nnan ninf float @_Z3logf(float %arg), !fpmath !0363 ret float %log364}365 366define <2 x float> @test_log_v2f32_preserve_flags(<2 x float> %arg) {367; CHECK-LABEL: define <2 x float> @test_log_v2f32_preserve_flags368; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {369; CHECK-NEXT: [[LOG:%.*]] = tail call nnan nsz contract <2 x float> @llvm.log.v2f32(<2 x float> [[ARG]]), !fpmath !0370; CHECK-NEXT: ret <2 x float> [[LOG]]371;372 %log = tail call contract nsz nnan <2 x float> @_Z3logDv2_f(<2 x float> %arg), !fpmath !0373 ret <2 x float> %log374}375 376define float @test_log_f32_preserve_flags_md(float %arg) {377; CHECK-LABEL: define float @test_log_f32_preserve_flags_md378; CHECK-SAME: (float [[ARG:%.*]]) {379; CHECK-NEXT: [[LOG:%.*]] = tail call nnan ninf float @llvm.log.f32(float [[ARG]]), !fpmath !0, !foo !1380; CHECK-NEXT: ret float [[LOG]]381;382 %log = tail call nnan ninf float @_Z3logf(float %arg), !fpmath !0, !foo !1383 ret float %log384}385 386define <2 x float> @test_log_v2f32_preserve_flags_md(<2 x float> %arg) {387; CHECK-LABEL: define <2 x float> @test_log_v2f32_preserve_flags_md388; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {389; CHECK-NEXT: [[LOG:%.*]] = tail call nnan nsz contract <2 x float> @llvm.log.v2f32(<2 x float> [[ARG]]), !fpmath !0, !foo !1390; CHECK-NEXT: ret <2 x float> [[LOG]]391;392 %log = tail call contract nsz nnan <2 x float> @_Z3logDv2_f(<2 x float> %arg), !fpmath !0, !foo !1393 ret <2 x float> %log394}395 396define float @test_log_cr_f32_preserve_flags(float %arg) {397; CHECK-LABEL: define float @test_log_cr_f32_preserve_flags398; CHECK-SAME: (float [[ARG:%.*]]) {399; CHECK-NEXT: [[LOG:%.*]] = tail call ninf contract float @llvm.log.f32(float [[ARG]])400; CHECK-NEXT: ret float [[LOG]]401;402 %log = tail call ninf contract float @_Z3logf(float %arg)403 ret float %log404}405 406define <2 x float> @test_log_cr_v2f32_preserve_flags(<2 x float> %arg) {407; CHECK-LABEL: define <2 x float> @test_log_cr_v2f32_preserve_flags408; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {409; CHECK-NEXT: [[LOG:%.*]] = tail call nnan nsz <2 x float> @llvm.log.v2f32(<2 x float> [[ARG]])410; CHECK-NEXT: ret <2 x float> [[LOG]]411;412 %log = tail call nnan nsz <2 x float> @_Z3logDv2_f(<2 x float> %arg)413 ret <2 x float> %log414}415 416; Test the libm name, not a recognized opencl builtin.417declare float @logf(float) #2418declare double @log(double) #2419 420define float @test_libm_log_f32(float %arg) {421; CHECK-LABEL: define float @test_libm_log_f32422; CHECK-SAME: (float [[ARG:%.*]]) {423; CHECK-NEXT: [[LOG:%.*]] = tail call float @logf(float [[ARG]])424; CHECK-NEXT: ret float [[LOG]]425;426 %log = tail call float @logf(float %arg)427 ret float %log428}429 430define float @test_libm_log_f32_fast(float %arg) {431; CHECK-LABEL: define float @test_libm_log_f32_fast432; CHECK-SAME: (float [[ARG:%.*]]) {433; CHECK-NEXT: [[LOG:%.*]] = tail call fast float @logf(float [[ARG]])434; CHECK-NEXT: ret float [[LOG]]435;436 %log = tail call fast float @logf(float %arg)437 ret float %log438}439 440define float @test_libm_log_f32_fpmath(float %arg) {441; CHECK-LABEL: define float @test_libm_log_f32_fpmath442; CHECK-SAME: (float [[ARG:%.*]]) {443; CHECK-NEXT: [[LOG:%.*]] = tail call float @logf(float [[ARG]]), !fpmath !0444; CHECK-NEXT: ret float [[LOG]]445;446 %log = tail call float @logf(float %arg), !fpmath !0447 ret float %log448}449 450define double @test_libm_log_f64(double %arg) {451; CHECK-LABEL: define double @test_libm_log_f64452; CHECK-SAME: (double [[ARG:%.*]]) {453; CHECK-NEXT: [[LOG:%.*]] = tail call double @log(double [[ARG]])454; CHECK-NEXT: ret double [[LOG]]455;456 %log = tail call double @log(double %arg)457 ret double %log458}459 460define double @test_libm_log_f64_fast(double %arg) {461; CHECK-LABEL: define double @test_libm_log_f64_fast462; CHECK-SAME: (double [[ARG:%.*]]) {463; CHECK-NEXT: [[LOG:%.*]] = tail call fast double @log(double [[ARG]])464; CHECK-NEXT: ret double [[LOG]]465;466 %log = tail call fast double @log(double %arg)467 ret double %log468}469 470define double @test_libm_log_f64_fpmath(double %arg) {471; CHECK-LABEL: define double @test_libm_log_f64_fpmath472; CHECK-SAME: (double [[ARG:%.*]]) {473; CHECK-NEXT: [[LOG:%.*]] = tail call double @log(double [[ARG]]), !fpmath !0474; CHECK-NEXT: ret double [[LOG]]475;476 %log = tail call double @log(double %arg), !fpmath !0477 ret double %log478}479 480define float @test_log_f32_fast_noinline(float %arg) {481; CHECK-LABEL: define float @test_log_f32_fast_noinline482; CHECK-SAME: (float [[ARG:%.*]]) {483; CHECK-NEXT: [[LOG:%.*]] = tail call fast float @_Z3logf(float [[ARG]]) #[[ATTR7:[0-9]+]], !fpmath !0484; CHECK-NEXT: ret float [[LOG]]485;486 %log = tail call fast float @_Z3logf(float %arg) #3, !fpmath !0487 ret float %log488}489 490define float @test_log_f32_fast_optsize(float %arg) #4 {491; CHECK-LABEL: define float @test_log_f32_fast_optsize492; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR2:[0-9]+]] {493; CHECK-NEXT: [[LOG:%.*]] = tail call fast float @llvm.log.f32(float [[ARG]]), !fpmath !0494; CHECK-NEXT: ret float [[LOG]]495;496 %log = tail call fast float @_Z3logf(float %arg), !fpmath !0497 ret float %log498}499 500define float @test_log_f32_fast_minsize(float %arg) #5 {501; CHECK-LABEL: define float @test_log_f32_fast_minsize502; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR3:[0-9]+]] {503; CHECK-NEXT: [[LOG:%.*]] = tail call fast float @llvm.log.f32(float [[ARG]]), !fpmath !0504; CHECK-NEXT: ret float [[LOG]]505;506 %log = tail call fast float @_Z3logf(float %arg), !fpmath !0507 ret float %log508}509 510define float @test_log_f32_nsz_contract_optsize(float %arg) #4 {511; CHECK-LABEL: define float @test_log_f32_nsz_contract_optsize512; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR2]] {513; CHECK-NEXT: [[LOG:%.*]] = tail call nsz contract float @llvm.log.f32(float [[ARG]]), !fpmath !0514; CHECK-NEXT: ret float [[LOG]]515;516 %log = tail call nsz contract float @_Z3logf(float %arg), !fpmath !0517 ret float %log518}519 520define float @test_log_f32_nsz_contract_minsize(float %arg) #5 {521; CHECK-LABEL: define float @test_log_f32_nsz_contract_minsize522; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR3]] {523; CHECK-NEXT: [[LOG:%.*]] = tail call nsz contract float @_Z3logf(float [[ARG]]), !fpmath !0524; CHECK-NEXT: ret float [[LOG]]525;526 %log = tail call nsz contract float @_Z3logf(float %arg), !fpmath !0527 ret float %log528}529 530define half @test_log_f16_fast_minsize(half %arg) #5 {531; CHECK-LABEL: define half @test_log_f16_fast_minsize532; CHECK-SAME: (half [[ARG:%.*]]) #[[ATTR3]] {533; CHECK-NEXT: [[LOG:%.*]] = tail call half @_Z3logDh(half [[ARG]])534; CHECK-NEXT: ret half [[LOG]]535;536 %log = tail call half @_Z3logDh(half %arg)537 ret half %log538}539 540define float @test_log_f32_strictfp(float %arg) #6 {541; CHECK-LABEL: define float @test_log_f32_strictfp542; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR4:[0-9]+]] {543; CHECK-NEXT: [[LOG:%.*]] = tail call nsz float @_Z3logf(float [[ARG]]) #[[ATTR4]]544; CHECK-NEXT: ret float [[LOG]]545;546 %log = tail call nsz float @_Z3logf(float %arg) #6547 ret float %log548}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