brintos

brintos / llvm-project-archived public Read only

0
0
Text · 12.5 KiB · 6a56deb Raw
257 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 @_Z3fmafff(float, float, float)5declare <2 x float> @_Z3fmaDv2_fS_S_(<2 x float>, <2 x float>, <2 x float>)6declare <3 x float> @_Z3fmaDv3_fS_S_(<3 x float>, <3 x float>, <3 x float>)7declare <4 x float> @_Z3fmaDv4_fS_S_(<4 x float>, <4 x float>, <4 x float>)8declare <8 x float> @_Z3fmaDv8_fS_S_(<8 x float>, <8 x float>, <8 x float>)9declare <16 x float> @_Z3fmaDv16_fS_S_(<16 x float>, <16 x float>, <16 x float>)10declare double @_Z3fmaddd(double, double, double)11declare <2 x double> @_Z3fmaDv2_dS_S_(<2 x double>, <2 x double>, <2 x double>)12declare <3 x double> @_Z3fmaDv3_dS_S_(<3 x double>, <3 x double>, <3 x double>)13declare <4 x double> @_Z3fmaDv4_dS_S_(<4 x double>, <4 x double>, <4 x double>)14declare <8 x double> @_Z3fmaDv8_dS_S_(<8 x double>, <8 x double>, <8 x double>)15declare <16 x double> @_Z3fmaDv16_dS_S_(<16 x double>, <16 x double>, <16 x double>)16declare half @_Z3fmaDhDhDh(half, half, half)17declare <2 x half> @_Z3fmaDv2_DhS_S_(<2 x half>, <2 x half>, <2 x half>)18declare <3 x half> @_Z3fmaDv3_DhS_S_(<3 x half>, <3 x half>, <3 x half>)19declare <4 x half> @_Z3fmaDv4_DhS_S_(<4 x half>, <4 x half>, <4 x half>)20declare <8 x half> @_Z3fmaDv8_DhS_S_(<8 x half>, <8 x half>, <8 x half>)21declare <16 x half> @_Z3fmaDv16_DhS_S_(<16 x half>, <16 x half>, <16 x half>)22 23define float @test_fma_f32(float %x, float %y, float %z) {24; CHECK-LABEL: define float @test_fma_f3225; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]], float [[Z:%.*]]) {26; CHECK-NEXT:    [[FMA:%.*]] = tail call float @llvm.fma.f32(float [[X]], float [[Y]], float [[Z]])27; CHECK-NEXT:    ret float [[FMA]]28;29  %fma = tail call float @_Z3fmafff(float %x, float %y, float %z)30  ret float %fma31}32 33define <2 x float> @test_fma_v2f32(<2 x float> %x, <2 x float> %y, <2 x float> %z) {34; CHECK-LABEL: define <2 x float> @test_fma_v2f3235; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x float> [[Y:%.*]], <2 x float> [[Z:%.*]]) {36; CHECK-NEXT:    [[FMA:%.*]] = tail call <2 x float> @llvm.fma.v2f32(<2 x float> [[X]], <2 x float> [[Y]], <2 x float> [[Z]])37; CHECK-NEXT:    ret <2 x float> [[FMA]]38;39  %fma = tail call <2 x float> @_Z3fmaDv2_fS_S_(<2 x float> %x, <2 x float> %y, <2 x float> %z)40  ret <2 x float> %fma41}42 43define <3 x float> @test_fma_v3f32(<3 x float> %x, <3 x float> %y, <3 x float> %z) {44; CHECK-LABEL: define <3 x float> @test_fma_v3f3245; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]], <3 x float> [[Z:%.*]]) {46; CHECK-NEXT:    [[FMA:%.*]] = tail call <3 x float> @llvm.fma.v3f32(<3 x float> [[X]], <3 x float> [[Y]], <3 x float> [[Z]])47; CHECK-NEXT:    ret <3 x float> [[FMA]]48;49  %fma = tail call <3 x float> @_Z3fmaDv3_fS_S_(<3 x float> %x, <3 x float> %y, <3 x float> %z)50  ret <3 x float> %fma51}52 53define <4 x float> @test_fma_v4f32(<4 x float> %x, <4 x float> %y, <4 x float> %z) {54; CHECK-LABEL: define <4 x float> @test_fma_v4f3255; CHECK-SAME: (<4 x float> [[X:%.*]], <4 x float> [[Y:%.*]], <4 x float> [[Z:%.*]]) {56; CHECK-NEXT:    [[FMA:%.*]] = tail call <4 x float> @llvm.fma.v4f32(<4 x float> [[X]], <4 x float> [[Y]], <4 x float> [[Z]])57; CHECK-NEXT:    ret <4 x float> [[FMA]]58;59  %fma = tail call <4 x float> @_Z3fmaDv4_fS_S_(<4 x float> %x, <4 x float> %y, <4 x float> %z)60  ret <4 x float> %fma61}62 63define <8 x float> @test_fma_v8f32(<8 x float> %x, <8 x float> %y, <8 x float> %z) {64; CHECK-LABEL: define <8 x float> @test_fma_v8f3265; CHECK-SAME: (<8 x float> [[X:%.*]], <8 x float> [[Y:%.*]], <8 x float> [[Z:%.*]]) {66; CHECK-NEXT:    [[FMA:%.*]] = tail call <8 x float> @llvm.fma.v8f32(<8 x float> [[X]], <8 x float> [[Y]], <8 x float> [[Z]])67; CHECK-NEXT:    ret <8 x float> [[FMA]]68;69  %fma = tail call <8 x float> @_Z3fmaDv8_fS_S_(<8 x float> %x, <8 x float> %y, <8 x float> %z)70  ret <8 x float> %fma71}72 73define <16 x float> @test_fma_v16f32(<16 x float> %x, <16 x float> %y, <16 x float> %z) {74; CHECK-LABEL: define <16 x float> @test_fma_v16f3275; CHECK-SAME: (<16 x float> [[X:%.*]], <16 x float> [[Y:%.*]], <16 x float> [[Z:%.*]]) {76; CHECK-NEXT:    [[FMA:%.*]] = tail call <16 x float> @llvm.fma.v16f32(<16 x float> [[X]], <16 x float> [[Y]], <16 x float> [[Z]])77; CHECK-NEXT:    ret <16 x float> [[FMA]]78;79  %fma = tail call <16 x float> @_Z3fmaDv16_fS_S_(<16 x float> %x, <16 x float> %y, <16 x float> %z)80  ret <16 x float> %fma81}82 83define double @test_fma_f64(double %x, double %y, double %z) {84; CHECK-LABEL: define double @test_fma_f6485; CHECK-SAME: (double [[X:%.*]], double [[Y:%.*]], double [[Z:%.*]]) {86; CHECK-NEXT:    [[FMA:%.*]] = tail call double @llvm.fma.f64(double [[X]], double [[Y]], double [[Z]])87; CHECK-NEXT:    ret double [[FMA]]88;89  %fma = tail call double @_Z3fmaddd(double %x, double %y, double %z)90  ret double %fma91}92 93define <2 x double> @test_fma_v2f64(<2 x double> %x, <2 x double> %y, <2 x double> %z) {94; CHECK-LABEL: define <2 x double> @test_fma_v2f6495; CHECK-SAME: (<2 x double> [[X:%.*]], <2 x double> [[Y:%.*]], <2 x double> [[Z:%.*]]) {96; CHECK-NEXT:    [[FMA:%.*]] = tail call <2 x double> @llvm.fma.v2f64(<2 x double> [[X]], <2 x double> [[Y]], <2 x double> [[Z]])97; CHECK-NEXT:    ret <2 x double> [[FMA]]98;99  %fma = tail call <2 x double> @_Z3fmaDv2_dS_S_(<2 x double> %x, <2 x double> %y, <2 x double> %z)100  ret <2 x double> %fma101}102 103define <3 x double> @test_fma_v3f64(<3 x double> %x, <3 x double> %y, <3 x double> %z) {104; CHECK-LABEL: define <3 x double> @test_fma_v3f64105; CHECK-SAME: (<3 x double> [[X:%.*]], <3 x double> [[Y:%.*]], <3 x double> [[Z:%.*]]) {106; CHECK-NEXT:    [[FMA:%.*]] = tail call <3 x double> @llvm.fma.v3f64(<3 x double> [[X]], <3 x double> [[Y]], <3 x double> [[Z]])107; CHECK-NEXT:    ret <3 x double> [[FMA]]108;109  %fma = tail call <3 x double> @_Z3fmaDv3_dS_S_(<3 x double> %x, <3 x double> %y, <3 x double> %z)110  ret <3 x double> %fma111}112 113define <4 x double> @test_fma_v4f64(<4 x double> %x, <4 x double> %y, <4 x double> %z) {114; CHECK-LABEL: define <4 x double> @test_fma_v4f64115; CHECK-SAME: (<4 x double> [[X:%.*]], <4 x double> [[Y:%.*]], <4 x double> [[Z:%.*]]) {116; CHECK-NEXT:    [[FMA:%.*]] = tail call <4 x double> @llvm.fma.v4f64(<4 x double> [[X]], <4 x double> [[Y]], <4 x double> [[Z]])117; CHECK-NEXT:    ret <4 x double> [[FMA]]118;119  %fma = tail call <4 x double> @_Z3fmaDv4_dS_S_(<4 x double> %x, <4 x double> %y, <4 x double> %z)120  ret <4 x double> %fma121}122 123define <8 x double> @test_fma_v8f64(<8 x double> %x, <8 x double> %y, <8 x double> %z) {124; CHECK-LABEL: define <8 x double> @test_fma_v8f64125; CHECK-SAME: (<8 x double> [[X:%.*]], <8 x double> [[Y:%.*]], <8 x double> [[Z:%.*]]) {126; CHECK-NEXT:    [[FMA:%.*]] = tail call <8 x double> @llvm.fma.v8f64(<8 x double> [[X]], <8 x double> [[Y]], <8 x double> [[Z]])127; CHECK-NEXT:    ret <8 x double> [[FMA]]128;129  %fma = tail call <8 x double> @_Z3fmaDv8_dS_S_(<8 x double> %x, <8 x double> %y, <8 x double> %z)130  ret <8 x double> %fma131}132 133define <16 x double> @test_fma_v16f64(<16 x double> %x, <16 x double> %y, <16 x double> %z) {134; CHECK-LABEL: define <16 x double> @test_fma_v16f64135; CHECK-SAME: (<16 x double> [[X:%.*]], <16 x double> [[Y:%.*]], <16 x double> [[Z:%.*]]) {136; CHECK-NEXT:    [[FMA:%.*]] = tail call <16 x double> @llvm.fma.v16f64(<16 x double> [[X]], <16 x double> [[Y]], <16 x double> [[Z]])137; CHECK-NEXT:    ret <16 x double> [[FMA]]138;139  %fma = tail call <16 x double> @_Z3fmaDv16_dS_S_(<16 x double> %x, <16 x double> %y, <16 x double> %z)140  ret <16 x double> %fma141}142 143define half @test_fma_f16(half %x, half %y, half %z) {144; CHECK-LABEL: define half @test_fma_f16145; CHECK-SAME: (half [[X:%.*]], half [[Y:%.*]], half [[Z:%.*]]) {146; CHECK-NEXT:    [[FMA:%.*]] = tail call half @llvm.fma.f16(half [[X]], half [[Y]], half [[Z]])147; CHECK-NEXT:    ret half [[FMA]]148;149  %fma = tail call half @_Z3fmaDhDhDh(half %x, half %y, half %z)150  ret half %fma151}152 153define <2 x half> @test_fma_v2f16(<2 x half> %x, <2 x half> %y, <2 x half> %z) {154; CHECK-LABEL: define <2 x half> @test_fma_v2f16155; CHECK-SAME: (<2 x half> [[X:%.*]], <2 x half> [[Y:%.*]], <2 x half> [[Z:%.*]]) {156; CHECK-NEXT:    [[FMA:%.*]] = tail call <2 x half> @llvm.fma.v2f16(<2 x half> [[X]], <2 x half> [[Y]], <2 x half> [[Z]])157; CHECK-NEXT:    ret <2 x half> [[FMA]]158;159  %fma = tail call <2 x half> @_Z3fmaDv2_DhS_S_(<2 x half> %x, <2 x half> %y, <2 x half> %z)160  ret <2 x half> %fma161}162 163define <3 x half> @test_fma_v3f16(<3 x half> %x, <3 x half> %y, <3 x half> %z) {164; CHECK-LABEL: define <3 x half> @test_fma_v3f16165; CHECK-SAME: (<3 x half> [[X:%.*]], <3 x half> [[Y:%.*]], <3 x half> [[Z:%.*]]) {166; CHECK-NEXT:    [[FMA:%.*]] = tail call <3 x half> @llvm.fma.v3f16(<3 x half> [[X]], <3 x half> [[Y]], <3 x half> [[Z]])167; CHECK-NEXT:    ret <3 x half> [[FMA]]168;169  %fma = tail call <3 x half> @_Z3fmaDv3_DhS_S_(<3 x half> %x, <3 x half> %y, <3 x half> %z)170  ret <3 x half> %fma171}172 173define <4 x half> @test_fma_v4f16(<4 x half> %x, <4 x half> %y, <4 x half> %z) {174; CHECK-LABEL: define <4 x half> @test_fma_v4f16175; CHECK-SAME: (<4 x half> [[X:%.*]], <4 x half> [[Y:%.*]], <4 x half> [[Z:%.*]]) {176; CHECK-NEXT:    [[FMA:%.*]] = tail call <4 x half> @llvm.fma.v4f16(<4 x half> [[X]], <4 x half> [[Y]], <4 x half> [[Z]])177; CHECK-NEXT:    ret <4 x half> [[FMA]]178;179  %fma = tail call <4 x half> @_Z3fmaDv4_DhS_S_(<4 x half> %x, <4 x half> %y, <4 x half> %z)180  ret <4 x half> %fma181}182 183define <8 x half> @test_fma_v8f16(<8 x half> %x, <8 x half> %y, <8 x half> %z) {184; CHECK-LABEL: define <8 x half> @test_fma_v8f16185; CHECK-SAME: (<8 x half> [[X:%.*]], <8 x half> [[Y:%.*]], <8 x half> [[Z:%.*]]) {186; CHECK-NEXT:    [[FMA:%.*]] = tail call <8 x half> @llvm.fma.v8f16(<8 x half> [[X]], <8 x half> [[Y]], <8 x half> [[Z]])187; CHECK-NEXT:    ret <8 x half> [[FMA]]188;189  %fma = tail call <8 x half> @_Z3fmaDv8_DhS_S_(<8 x half> %x, <8 x half> %y, <8 x half> %z)190  ret <8 x half> %fma191}192 193define <16 x half> @test_fma_v16f16(<16 x half> %x, <16 x half> %y, <16 x half> %z) {194; CHECK-LABEL: define <16 x half> @test_fma_v16f16195; CHECK-SAME: (<16 x half> [[X:%.*]], <16 x half> [[Y:%.*]], <16 x half> [[Z:%.*]]) {196; CHECK-NEXT:    [[FMA:%.*]] = tail call <16 x half> @llvm.fma.v16f16(<16 x half> [[X]], <16 x half> [[Y]], <16 x half> [[Z]])197; CHECK-NEXT:    ret <16 x half> [[FMA]]198;199  %fma = tail call <16 x half> @_Z3fmaDv16_DhS_S_(<16 x half> %x, <16 x half> %y, <16 x half> %z)200  ret <16 x half> %fma201}202 203define float @test_fma_f32_fast(float %x, float %y, float %z) {204; CHECK-LABEL: define float @test_fma_f32_fast205; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]], float [[Z:%.*]]) {206; CHECK-NEXT:    [[FMA:%.*]] = tail call fast float @llvm.fma.f32(float [[X]], float [[Y]], float [[Z]])207; CHECK-NEXT:    ret float [[FMA]]208;209  %fma = tail call fast float @_Z3fmafff(float %x, float %y, float %z)210  ret float %fma211}212 213define float @test_fma_f32_noinline(float %x, float %y, float %z) {214; CHECK-LABEL: define float @test_fma_f32_noinline215; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]], float [[Z:%.*]]) {216; CHECK-NEXT:    [[FMA:%.*]] = tail call fast float @_Z3fmafff(float [[X]], float [[Y]], float [[Z]]) #[[ATTR3:[0-9]+]]217; CHECK-NEXT:    ret float [[FMA]]218;219  %fma = tail call fast float @_Z3fmafff(float %x, float %y, float %z) #1220  ret float %fma221}222 223define float @test_fma_f32_fast_minsize(float %x, float %y, float %z) #0 {224; CHECK-LABEL: define float @test_fma_f32_fast_minsize225; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]], float [[Z:%.*]]) #[[ATTR0:[0-9]+]] {226; CHECK-NEXT:    [[FMA:%.*]] = tail call fast float @llvm.fma.f32(float [[X]], float [[Y]], float [[Z]])227; CHECK-NEXT:    ret float [[FMA]]228;229  %fma = tail call fast float @_Z3fmafff(float %x, float %y, float %z)230  ret float %fma231}232 233define float @test_fma_f32_fast_strictfp(float %x, float %y, float %z) #2 {234; CHECK-LABEL: define float @test_fma_f32_fast_strictfp235; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]], float [[Z:%.*]]) #[[ATTR1:[0-9]+]] {236; CHECK-NEXT:    [[FMA:%.*]] = tail call nnan nsz float @_Z3fmafff(float [[X]], float [[Y]], float [[Z]]) #[[ATTR1]]237; CHECK-NEXT:    ret float [[FMA]]238;239  %fma = tail call nsz nnan float @_Z3fmafff(float %x, float %y, float %z) #2240  ret float %fma241}242 243define float @test_fma_f32_fast_nobuiltin(float %x, float %y, float %z) {244; CHECK-LABEL: define float @test_fma_f32_fast_nobuiltin245; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]], float [[Z:%.*]]) {246; CHECK-NEXT:    [[FMA:%.*]] = tail call fast float @_Z3fmafff(float [[X]], float [[Y]], float [[Z]]) #[[ATTR4:[0-9]+]]247; CHECK-NEXT:    ret float [[FMA]]248;249  %fma = tail call fast float @_Z3fmafff(float %x, float %y, float %z) #3250  ret float %fma251}252 253attributes #0 = { minsize }254attributes #1 = { noinline }255attributes #2 = { strictfp }256attributes #3 = { nobuiltin }257