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 @_Z4log2f(float)5declare <2 x float> @_Z4log2Dv2_f(<2 x float>)6declare <3 x float> @_Z4log2Dv3_f(<3 x float>)7declare <4 x float> @_Z4log2Dv4_f(<4 x float>)8declare <8 x float> @_Z4log2Dv8_f(<8 x float>)9declare <16 x float> @_Z4log2Dv16_f(<16 x float>)10 11declare double @_Z4log2d(double)12declare <2 x double> @_Z4log2Dv2_d(<2 x double>)13declare <3 x double> @_Z4log2Dv3_d(<3 x double>)14declare <4 x double> @_Z4log2Dv4_d(<4 x double>)15declare <8 x double> @_Z4log2Dv8_d(<8 x double>)16declare <16 x double> @_Z4log2Dv16_d(<16 x double>)17 18declare half @_Z4log2Dh(half)19declare <2 x half> @_Z4log2Dv2_Dh(<2 x half>)20declare <3 x half> @_Z4log2Dv3_Dh(<3 x half>)21declare <4 x half> @_Z4log2Dv4_Dh(<4 x half>)22declare <8 x half> @_Z4log2Dv8_Dh(<8 x half>)23declare <16 x half> @_Z4log2Dv16_Dh(<16 x half>)24 25define float @test_log2_f32(float %arg) {26; CHECK-LABEL: define float @test_log2_f3227; CHECK-SAME: (float [[ARG:%.*]]) {28; CHECK-NEXT: [[LOG2:%.*]] = tail call float @_Z4log2f(float [[ARG]]), !fpmath !029; CHECK-NEXT: ret float [[LOG2]]30;31 %log2 = tail call float @_Z4log2f(float %arg), !fpmath !032 ret float %log233}34 35define <2 x float> @test_log2_v2f32(<2 x float> %arg) {36; CHECK-LABEL: define <2 x float> @test_log2_v2f3237; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {38; CHECK-NEXT: [[LOG2:%.*]] = tail call <2 x float> @_Z4log2Dv2_f(<2 x float> [[ARG]]), !fpmath !039; CHECK-NEXT: ret <2 x float> [[LOG2]]40;41 %log2 = tail call <2 x float> @_Z4log2Dv2_f(<2 x float> %arg), !fpmath !042 ret <2 x float> %log243}44 45define <3 x float> @test_log2_v3f32(<3 x float> %arg) {46; CHECK-LABEL: define <3 x float> @test_log2_v3f3247; CHECK-SAME: (<3 x float> [[ARG:%.*]]) {48; CHECK-NEXT: [[LOG2:%.*]] = tail call <3 x float> @_Z4log2Dv3_f(<3 x float> [[ARG]]), !fpmath !049; CHECK-NEXT: ret <3 x float> [[LOG2]]50;51 %log2 = tail call <3 x float> @_Z4log2Dv3_f(<3 x float> %arg), !fpmath !052 ret <3 x float> %log253}54 55define <4 x float> @test_log2_v4f32(<4 x float> %arg) {56; CHECK-LABEL: define <4 x float> @test_log2_v4f3257; CHECK-SAME: (<4 x float> [[ARG:%.*]]) {58; CHECK-NEXT: [[LOG2:%.*]] = tail call <4 x float> @_Z4log2Dv4_f(<4 x float> [[ARG]]), !fpmath !059; CHECK-NEXT: ret <4 x float> [[LOG2]]60;61 %log2 = tail call <4 x float> @_Z4log2Dv4_f(<4 x float> %arg), !fpmath !062 ret <4 x float> %log263}64 65define <8 x float> @test_log2_v8f32(<8 x float> %arg) {66; CHECK-LABEL: define <8 x float> @test_log2_v8f3267; CHECK-SAME: (<8 x float> [[ARG:%.*]]) {68; CHECK-NEXT: [[LOG2:%.*]] = tail call <8 x float> @_Z4log2Dv8_f(<8 x float> [[ARG]]), !fpmath !069; CHECK-NEXT: ret <8 x float> [[LOG2]]70;71 %log2 = tail call <8 x float> @_Z4log2Dv8_f(<8 x float> %arg), !fpmath !072 ret <8 x float> %log273}74 75define <16 x float> @test_log2_v16f32(<16 x float> %arg) {76; CHECK-LABEL: define <16 x float> @test_log2_v16f3277; CHECK-SAME: (<16 x float> [[ARG:%.*]]) {78; CHECK-NEXT: [[LOG2:%.*]] = tail call <16 x float> @_Z4log2Dv16_f(<16 x float> [[ARG]]), !fpmath !079; CHECK-NEXT: ret <16 x float> [[LOG2]]80;81 %log2 = tail call <16 x float> @_Z4log2Dv16_f(<16 x float> %arg), !fpmath !082 ret <16 x float> %log283}84 85define float @test_log2_cr_f32(float %arg) {86; CHECK-LABEL: define float @test_log2_cr_f3287; CHECK-SAME: (float [[ARG:%.*]]) {88; CHECK-NEXT: [[LOG2:%.*]] = tail call float @_Z4log2f(float [[ARG]])89; CHECK-NEXT: ret float [[LOG2]]90;91 %log2 = tail call float @_Z4log2f(float %arg)92 ret float %log293}94 95define <2 x float> @test_log2_cr_v2f32(<2 x float> %arg) {96; CHECK-LABEL: define <2 x float> @test_log2_cr_v2f3297; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {98; CHECK-NEXT: [[LOG2:%.*]] = tail call <2 x float> @_Z4log2Dv2_f(<2 x float> [[ARG]])99; CHECK-NEXT: ret <2 x float> [[LOG2]]100;101 %log2 = tail call <2 x float> @_Z4log2Dv2_f(<2 x float> %arg)102 ret <2 x float> %log2103}104 105define <3 x float> @test_log2_cr_v3f32(<3 x float> %arg) {106; CHECK-LABEL: define <3 x float> @test_log2_cr_v3f32107; CHECK-SAME: (<3 x float> [[ARG:%.*]]) {108; CHECK-NEXT: [[LOG2:%.*]] = tail call <3 x float> @_Z4log2Dv3_f(<3 x float> [[ARG]])109; CHECK-NEXT: ret <3 x float> [[LOG2]]110;111 %log2 = tail call <3 x float> @_Z4log2Dv3_f(<3 x float> %arg)112 ret <3 x float> %log2113}114 115define <4 x float> @test_log2_cr_v4f32(<4 x float> %arg) {116; CHECK-LABEL: define <4 x float> @test_log2_cr_v4f32117; CHECK-SAME: (<4 x float> [[ARG:%.*]]) {118; CHECK-NEXT: [[LOG2:%.*]] = tail call <4 x float> @_Z4log2Dv4_f(<4 x float> [[ARG]])119; CHECK-NEXT: ret <4 x float> [[LOG2]]120;121 %log2 = tail call <4 x float> @_Z4log2Dv4_f(<4 x float> %arg)122 ret <4 x float> %log2123}124 125define <8 x float> @test_log2_cr_v8f32(<8 x float> %arg) {126; CHECK-LABEL: define <8 x float> @test_log2_cr_v8f32127; CHECK-SAME: (<8 x float> [[ARG:%.*]]) {128; CHECK-NEXT: [[LOG2:%.*]] = tail call <8 x float> @_Z4log2Dv8_f(<8 x float> [[ARG]])129; CHECK-NEXT: ret <8 x float> [[LOG2]]130;131 %log2 = tail call <8 x float> @_Z4log2Dv8_f(<8 x float> %arg)132 ret <8 x float> %log2133}134 135define <16 x float> @test_log2_cr_v16f32(<16 x float> %arg) {136; CHECK-LABEL: define <16 x float> @test_log2_cr_v16f32137; CHECK-SAME: (<16 x float> [[ARG:%.*]]) {138; CHECK-NEXT: [[LOG2:%.*]] = tail call <16 x float> @_Z4log2Dv16_f(<16 x float> [[ARG]])139; CHECK-NEXT: ret <16 x float> [[LOG2]]140;141 %log2 = tail call <16 x float> @_Z4log2Dv16_f(<16 x float> %arg)142 ret <16 x float> %log2143}144 145define double @test_log2_f64(double %arg) {146; CHECK-LABEL: define double @test_log2_f64147; CHECK-SAME: (double [[ARG:%.*]]) {148; CHECK-NEXT: [[LOG2:%.*]] = tail call double @_Z4log2d(double [[ARG]])149; CHECK-NEXT: ret double [[LOG2]]150;151 %log2 = tail call double @_Z4log2d(double %arg)152 ret double %log2153}154 155define <2 x double> @test_log2_v2f64(<2 x double> %arg) {156; CHECK-LABEL: define <2 x double> @test_log2_v2f64157; CHECK-SAME: (<2 x double> [[ARG:%.*]]) {158; CHECK-NEXT: [[LOG2:%.*]] = tail call <2 x double> @_Z4log2Dv2_d(<2 x double> [[ARG]])159; CHECK-NEXT: ret <2 x double> [[LOG2]]160;161 %log2 = tail call <2 x double> @_Z4log2Dv2_d(<2 x double> %arg)162 ret <2 x double> %log2163}164 165define <3 x double> @test_log2_v3f64(<3 x double> %arg) {166; CHECK-LABEL: define <3 x double> @test_log2_v3f64167; CHECK-SAME: (<3 x double> [[ARG:%.*]]) {168; CHECK-NEXT: [[LOG2:%.*]] = tail call <3 x double> @_Z4log2Dv3_d(<3 x double> [[ARG]])169; CHECK-NEXT: ret <3 x double> [[LOG2]]170;171 %log2 = tail call <3 x double> @_Z4log2Dv3_d(<3 x double> %arg)172 ret <3 x double> %log2173}174 175define <4 x double> @test_log2_v4f64(<4 x double> %arg) {176; CHECK-LABEL: define <4 x double> @test_log2_v4f64177; CHECK-SAME: (<4 x double> [[ARG:%.*]]) {178; CHECK-NEXT: [[LOG2:%.*]] = tail call <4 x double> @_Z4log2Dv4_d(<4 x double> [[ARG]])179; CHECK-NEXT: ret <4 x double> [[LOG2]]180;181 %log2 = tail call <4 x double> @_Z4log2Dv4_d(<4 x double> %arg)182 ret <4 x double> %log2183}184 185define <8 x double> @test_log2_v8f64(<8 x double> %arg) {186; CHECK-LABEL: define <8 x double> @test_log2_v8f64187; CHECK-SAME: (<8 x double> [[ARG:%.*]]) {188; CHECK-NEXT: [[LOG2:%.*]] = tail call <8 x double> @_Z4log2Dv8_d(<8 x double> [[ARG]])189; CHECK-NEXT: ret <8 x double> [[LOG2]]190;191 %log2 = tail call <8 x double> @_Z4log2Dv8_d(<8 x double> %arg)192 ret <8 x double> %log2193}194 195define <16 x double> @test_log2_v16f64(<16 x double> %arg) {196; CHECK-LABEL: define <16 x double> @test_log2_v16f64197; CHECK-SAME: (<16 x double> [[ARG:%.*]]) {198; CHECK-NEXT: [[LOG2:%.*]] = tail call <16 x double> @_Z4log2Dv16_d(<16 x double> [[ARG]])199; CHECK-NEXT: ret <16 x double> [[LOG2]]200;201 %log2 = tail call <16 x double> @_Z4log2Dv16_d(<16 x double> %arg)202 ret <16 x double> %log2203}204 205define half @test_log2_f16(half %arg) {206; CHECK-LABEL: define half @test_log2_f16207; CHECK-SAME: (half [[ARG:%.*]]) {208; CHECK-NEXT: [[LOG2:%.*]] = tail call half @_Z4log2Dh(half [[ARG]])209; CHECK-NEXT: ret half [[LOG2]]210;211 %log2 = tail call half @_Z4log2Dh(half %arg)212 ret half %log2213}214 215define half @test_log2_f16_fast(half %arg) {216; CHECK-LABEL: define half @test_log2_f16_fast217; CHECK-SAME: (half [[ARG:%.*]]) {218; CHECK-NEXT: [[LOG2:%.*]] = tail call fast half @llvm.log2.f16(half [[ARG]])219; CHECK-NEXT: ret half [[LOG2]]220;221 %log2 = tail call fast half @_Z4log2Dh(half %arg)222 ret half %log2223}224 225define <2 x half> @test_log2_v2f16(<2 x half> %arg) {226; CHECK-LABEL: define <2 x half> @test_log2_v2f16227; CHECK-SAME: (<2 x half> [[ARG:%.*]]) {228; CHECK-NEXT: [[LOG2:%.*]] = tail call <2 x half> @_Z4log2Dv2_Dh(<2 x half> [[ARG]])229; CHECK-NEXT: ret <2 x half> [[LOG2]]230;231 %log2 = tail call <2 x half> @_Z4log2Dv2_Dh(<2 x half> %arg)232 ret <2 x half> %log2233}234 235define <3 x half> @test_log2_v3f16(<3 x half> %arg) {236; CHECK-LABEL: define <3 x half> @test_log2_v3f16237; CHECK-SAME: (<3 x half> [[ARG:%.*]]) {238; CHECK-NEXT: [[LOG2:%.*]] = tail call <3 x half> @_Z4log2Dv3_Dh(<3 x half> [[ARG]])239; CHECK-NEXT: ret <3 x half> [[LOG2]]240;241 %log2 = tail call <3 x half> @_Z4log2Dv3_Dh(<3 x half> %arg)242 ret <3 x half> %log2243}244 245define <4 x half> @test_log2_v4f16(<4 x half> %arg) {246; CHECK-LABEL: define <4 x half> @test_log2_v4f16247; CHECK-SAME: (<4 x half> [[ARG:%.*]]) {248; CHECK-NEXT: [[LOG2:%.*]] = tail call <4 x half> @_Z4log2Dv4_Dh(<4 x half> [[ARG]])249; CHECK-NEXT: ret <4 x half> [[LOG2]]250;251 %log2 = tail call <4 x half> @_Z4log2Dv4_Dh(<4 x half> %arg)252 ret <4 x half> %log2253}254 255define <8 x half> @test_log2_v8f16(<8 x half> %arg) {256; CHECK-LABEL: define <8 x half> @test_log2_v8f16257; CHECK-SAME: (<8 x half> [[ARG:%.*]]) {258; CHECK-NEXT: [[LOG2:%.*]] = tail call <8 x half> @_Z4log2Dv8_Dh(<8 x half> [[ARG]])259; CHECK-NEXT: ret <8 x half> [[LOG2]]260;261 %log2 = tail call <8 x half> @_Z4log2Dv8_Dh(<8 x half> %arg)262 ret <8 x half> %log2263}264 265define <16 x half> @test_log2_v16f16(<16 x half> %arg) {266; CHECK-LABEL: define <16 x half> @test_log2_v16f16267; CHECK-SAME: (<16 x half> [[ARG:%.*]]) {268; CHECK-NEXT: [[LOG2:%.*]] = tail call <16 x half> @_Z4log2Dv16_Dh(<16 x half> [[ARG]])269; CHECK-NEXT: ret <16 x half> [[LOG2]]270;271 %log2 = tail call <16 x half> @_Z4log2Dv16_Dh(<16 x half> %arg)272 ret <16 x half> %log2273}274 275define float @test_log2_f32_nobuiltin_callsite(float %arg) {276; CHECK-LABEL: define float @test_log2_f32_nobuiltin_callsite277; CHECK-SAME: (float [[ARG:%.*]]) {278; CHECK-NEXT: [[LOG2:%.*]] = tail call float @_Z4log2f(float [[ARG]]) #[[ATTR6:[0-9]+]], !fpmath !0279; CHECK-NEXT: ret float [[LOG2]]280;281 %log2 = tail call float @_Z4log2f(float %arg) #0, !fpmath !0282 ret float %log2283}284 285define <2 x float> @test_log2_v2f32_nobuiltin_callsite(<2 x float> %arg) {286; CHECK-LABEL: define <2 x float> @test_log2_v2f32_nobuiltin_callsite287; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {288; CHECK-NEXT: [[LOG2:%.*]] = tail call <2 x float> @_Z4log2Dv2_f(<2 x float> [[ARG]]) #[[ATTR6]], !fpmath !0289; CHECK-NEXT: ret <2 x float> [[LOG2]]290;291 %log2 = tail call <2 x float> @_Z4log2Dv2_f(<2 x float> %arg) #0, !fpmath !0292 ret <2 x float> %log2293}294 295define float @test_log2_cr_f32_nobuiltin_callsite(float %arg) {296; CHECK-LABEL: define float @test_log2_cr_f32_nobuiltin_callsite297; CHECK-SAME: (float [[ARG:%.*]]) {298; CHECK-NEXT: [[LOG2:%.*]] = tail call float @_Z4log2f(float [[ARG]]) #[[ATTR6]]299; CHECK-NEXT: ret float [[LOG2]]300;301 %log2 = tail call float @_Z4log2f(float %arg) #0302 ret float %log2303}304 305define <2 x float> @test_log2_cr_v2f32_nobuiltin_callsite(<2 x float> %arg) {306; CHECK-LABEL: define <2 x float> @test_log2_cr_v2f32_nobuiltin_callsite307; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {308; CHECK-NEXT: [[LOG2:%.*]] = tail call <2 x float> @_Z4log2Dv2_f(<2 x float> [[ARG]]) #[[ATTR6]]309; CHECK-NEXT: ret <2 x float> [[LOG2]]310;311 %log2 = tail call <2 x float> @_Z4log2Dv2_f(<2 x float> %arg) #0312 ret <2 x float> %log2313}314 315; "no-builtins" should be ignored316define float @test_log2_f32_nobuiltins(float %arg) #1 {317; CHECK-LABEL: define float @test_log2_f32_nobuiltins318; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR0:[0-9]+]] {319; CHECK-NEXT: [[LOG2:%.*]] = tail call float @_Z4log2f(float [[ARG]]) #[[ATTR6]], !fpmath !0320; CHECK-NEXT: ret float [[LOG2]]321;322 %log2 = tail call float @_Z4log2f(float %arg) #0, !fpmath !0323 ret float %log2324}325 326define <2 x float> @test_log2_v2f32_nobuiltins(<2 x float> %arg) #1 {327; CHECK-LABEL: define <2 x float> @test_log2_v2f32_nobuiltins328; CHECK-SAME: (<2 x float> [[ARG:%.*]]) #[[ATTR0]] {329; CHECK-NEXT: [[LOG2:%.*]] = tail call <2 x float> @_Z4log2Dv2_f(<2 x float> [[ARG]]) #[[ATTR6]], !fpmath !0330; CHECK-NEXT: ret <2 x float> [[LOG2]]331;332 %log2 = tail call <2 x float> @_Z4log2Dv2_f(<2 x float> %arg) #0, !fpmath !0333 ret <2 x float> %log2334}335 336define float @test_log2_cr_f32_nobuiltins(float %arg) #1 {337; CHECK-LABEL: define float @test_log2_cr_f32_nobuiltins338; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR0]] {339; CHECK-NEXT: [[LOG2:%.*]] = tail call float @_Z4log2f(float [[ARG]]) #[[ATTR6]]340; CHECK-NEXT: ret float [[LOG2]]341;342 %log2 = tail call float @_Z4log2f(float %arg) #0343 ret float %log2344}345 346define <2 x float> @test_log2_cr_v2f32_nobuiltins(<2 x float> %arg) #1 {347; CHECK-LABEL: define <2 x float> @test_log2_cr_v2f32_nobuiltins348; CHECK-SAME: (<2 x float> [[ARG:%.*]]) #[[ATTR0]] {349; CHECK-NEXT: [[LOG2:%.*]] = tail call <2 x float> @_Z4log2Dv2_f(<2 x float> [[ARG]]) #[[ATTR6]]350; CHECK-NEXT: ret <2 x float> [[LOG2]]351;352 %log2 = tail call <2 x float> @_Z4log2Dv2_f(<2 x float> %arg) #0353 ret <2 x float> %log2354}355 356define float @test_log2_f32_preserve_flags(float %arg) {357; CHECK-LABEL: define float @test_log2_f32_preserve_flags358; CHECK-SAME: (float [[ARG:%.*]]) {359; CHECK-NEXT: [[LOG2:%.*]] = tail call nnan ninf float @llvm.log2.f32(float [[ARG]]), !fpmath !0360; CHECK-NEXT: ret float [[LOG2]]361;362 %log2 = tail call nnan ninf float @_Z4log2f(float %arg), !fpmath !0363 ret float %log2364}365 366define <2 x float> @test_log2_v2f32_preserve_flags(<2 x float> %arg) {367; CHECK-LABEL: define <2 x float> @test_log2_v2f32_preserve_flags368; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {369; CHECK-NEXT: [[LOG2:%.*]] = tail call nnan nsz contract <2 x float> @llvm.log2.v2f32(<2 x float> [[ARG]]), !fpmath !0370; CHECK-NEXT: ret <2 x float> [[LOG2]]371;372 %log2 = tail call contract nsz nnan <2 x float> @_Z4log2Dv2_f(<2 x float> %arg), !fpmath !0373 ret <2 x float> %log2374}375 376define float @test_log2_f32_preserve_flags_md(float %arg) {377; CHECK-LABEL: define float @test_log2_f32_preserve_flags_md378; CHECK-SAME: (float [[ARG:%.*]]) {379; CHECK-NEXT: [[LOG2:%.*]] = tail call nnan ninf float @llvm.log2.f32(float [[ARG]]), !fpmath !0, !foo !1380; CHECK-NEXT: ret float [[LOG2]]381;382 %log2 = tail call nnan ninf float @_Z4log2f(float %arg), !fpmath !0, !foo !1383 ret float %log2384}385 386define <2 x float> @test_log2_v2f32_preserve_flags_md(<2 x float> %arg) {387; CHECK-LABEL: define <2 x float> @test_log2_v2f32_preserve_flags_md388; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {389; CHECK-NEXT: [[LOG2:%.*]] = tail call nnan nsz contract <2 x float> @llvm.log2.v2f32(<2 x float> [[ARG]]), !fpmath !0, !foo !1390; CHECK-NEXT: ret <2 x float> [[LOG2]]391;392 %log2 = tail call contract nsz nnan <2 x float> @_Z4log2Dv2_f(<2 x float> %arg), !fpmath !0, !foo !1393 ret <2 x float> %log2394}395 396define float @test_log2_cr_f32_preserve_flags(float %arg) {397; CHECK-LABEL: define float @test_log2_cr_f32_preserve_flags398; CHECK-SAME: (float [[ARG:%.*]]) {399; CHECK-NEXT: [[LOG2:%.*]] = tail call ninf contract float @llvm.log2.f32(float [[ARG]])400; CHECK-NEXT: ret float [[LOG2]]401;402 %log2 = tail call ninf contract float @_Z4log2f(float %arg)403 ret float %log2404}405 406define <2 x float> @test_log2_cr_v2f32_preserve_flags(<2 x float> %arg) {407; CHECK-LABEL: define <2 x float> @test_log2_cr_v2f32_preserve_flags408; CHECK-SAME: (<2 x float> [[ARG:%.*]]) {409; CHECK-NEXT: [[LOG2:%.*]] = tail call nnan nsz <2 x float> @llvm.log2.v2f32(<2 x float> [[ARG]])410; CHECK-NEXT: ret <2 x float> [[LOG2]]411;412 %log2 = tail call nnan nsz <2 x float> @_Z4log2Dv2_f(<2 x float> %arg)413 ret <2 x float> %log2414}415 416; Test the libm name, not a recognized opencl builtin.417declare float @log2f(float) #2418declare double @log2(double) #2419 420define float @test_libm_log2_f32(float %arg) {421; CHECK-LABEL: define float @test_libm_log2_f32422; CHECK-SAME: (float [[ARG:%.*]]) {423; CHECK-NEXT: [[LOG2:%.*]] = tail call float @log2f(float [[ARG]])424; CHECK-NEXT: ret float [[LOG2]]425;426 %log2 = tail call float @log2f(float %arg)427 ret float %log2428}429 430define float @test_libm_log2_f32_fast(float %arg) {431; CHECK-LABEL: define float @test_libm_log2_f32_fast432; CHECK-SAME: (float [[ARG:%.*]]) {433; CHECK-NEXT: [[LOG2:%.*]] = tail call fast float @log2f(float [[ARG]])434; CHECK-NEXT: ret float [[LOG2]]435;436 %log2 = tail call fast float @log2f(float %arg)437 ret float %log2438}439 440define float @test_libm_log2_f32_fpmath(float %arg) {441; CHECK-LABEL: define float @test_libm_log2_f32_fpmath442; CHECK-SAME: (float [[ARG:%.*]]) {443; CHECK-NEXT: [[LOG2:%.*]] = tail call float @log2f(float [[ARG]]), !fpmath !0444; CHECK-NEXT: ret float [[LOG2]]445;446 %log2 = tail call float @log2f(float %arg), !fpmath !0447 ret float %log2448}449 450define double @test_libm_log2_f64(double %arg) {451; CHECK-LABEL: define double @test_libm_log2_f64452; CHECK-SAME: (double [[ARG:%.*]]) {453; CHECK-NEXT: [[LOG2:%.*]] = tail call double @log2(double [[ARG]])454; CHECK-NEXT: ret double [[LOG2]]455;456 %log2 = tail call double @log2(double %arg)457 ret double %log2458}459 460define double @test_libm_log2_f64_fast(double %arg) {461; CHECK-LABEL: define double @test_libm_log2_f64_fast462; CHECK-SAME: (double [[ARG:%.*]]) {463; CHECK-NEXT: [[LOG2:%.*]] = tail call fast double @log2(double [[ARG]])464; CHECK-NEXT: ret double [[LOG2]]465;466 %log2 = tail call fast double @log2(double %arg)467 ret double %log2468}469 470define double @test_libm_log2_f64_fpmath(double %arg) {471; CHECK-LABEL: define double @test_libm_log2_f64_fpmath472; CHECK-SAME: (double [[ARG:%.*]]) {473; CHECK-NEXT: [[LOG2:%.*]] = tail call double @log2(double [[ARG]]), !fpmath !0474; CHECK-NEXT: ret double [[LOG2]]475;476 %log2 = tail call double @log2(double %arg), !fpmath !0477 ret double %log2478}479 480define float @test_log2_f32_fast_noinline(float %arg) {481; CHECK-LABEL: define float @test_log2_f32_fast_noinline482; CHECK-SAME: (float [[ARG:%.*]]) {483; CHECK-NEXT: [[LOG2:%.*]] = tail call fast float @_Z4log2f(float [[ARG]]) #[[ATTR7:[0-9]+]], !fpmath !0484; CHECK-NEXT: ret float [[LOG2]]485;486 %log2 = tail call fast float @_Z4log2f(float %arg) #3, !fpmath !0487 ret float %log2488}489 490define float @test_log2_f32_fast_optsize(float %arg) #4 {491; CHECK-LABEL: define float @test_log2_f32_fast_optsize492; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR2:[0-9]+]] {493; CHECK-NEXT: [[LOG2:%.*]] = tail call fast float @llvm.log2.f32(float [[ARG]]), !fpmath !0494; CHECK-NEXT: ret float [[LOG2]]495;496 %log2 = tail call fast float @_Z4log2f(float %arg), !fpmath !0497 ret float %log2498}499 500define float @test_log2_f32_fast_minsize(float %arg) #5 {501; CHECK-LABEL: define float @test_log2_f32_fast_minsize502; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR3:[0-9]+]] {503; CHECK-NEXT: [[LOG2:%.*]] = tail call fast float @llvm.log2.f32(float [[ARG]]), !fpmath !0504; CHECK-NEXT: ret float [[LOG2]]505;506 %log2 = tail call fast float @_Z4log2f(float %arg), !fpmath !0507 ret float %log2508}509 510define float @test_log2_f32_nsz_contract_optsize(float %arg) #4 {511; CHECK-LABEL: define float @test_log2_f32_nsz_contract_optsize512; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR2]] {513; CHECK-NEXT: [[LOG2:%.*]] = tail call nsz contract float @llvm.log2.f32(float [[ARG]]), !fpmath !0514; CHECK-NEXT: ret float [[LOG2]]515;516 %log2 = tail call nsz contract float @_Z4log2f(float %arg), !fpmath !0517 ret float %log2518}519 520define float @test_log2_f32_nsz_contract_minsize(float %arg) #5 {521; CHECK-LABEL: define float @test_log2_f32_nsz_contract_minsize522; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR3]] {523; CHECK-NEXT: [[LOG2:%.*]] = tail call nsz contract float @_Z4log2f(float [[ARG]]), !fpmath !0524; CHECK-NEXT: ret float [[LOG2]]525;526 %log2 = tail call nsz contract float @_Z4log2f(float %arg), !fpmath !0527 ret float %log2528}529 530define half @test_log2_f16_fast_minsize(half %arg) #5 {531; CHECK-LABEL: define half @test_log2_f16_fast_minsize532; CHECK-SAME: (half [[ARG:%.*]]) #[[ATTR3]] {533; CHECK-NEXT: [[LOG2:%.*]] = tail call fast half @llvm.log2.f16(half [[ARG]])534; CHECK-NEXT: ret half [[LOG2]]535;536 %log2 = tail call fast half @_Z4log2Dh(half %arg)537 ret half %log2538}539 540define float @test_log2_f32_strictfp(float %arg) #6 {541; CHECK-LABEL: define float @test_log2_f32_strictfp542; CHECK-SAME: (float [[ARG:%.*]]) #[[ATTR4:[0-9]+]] {543; CHECK-NEXT: [[LOG:%.*]] = tail call nsz float @_Z4log2f(float [[ARG]]) #[[ATTR4]]544; CHECK-NEXT: ret float [[LOG]]545;546 %log = tail call nsz float @_Z4log2f(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