1 ; RUN: opt -mtriple=amdgcn--amdhsa -S -O3 -enable-unsafe-fp-math %s | FileCheck -check-prefix=GCN -check-prefix=UNSAFE %s
2 ; RUN: opt -mtriple=amdgcn--amdhsa -S -O3 -enable-no-nans-fp-math %s | FileCheck -check-prefix=GCN -check-prefix=NONANS %s
3 ; RUN: opt -mtriple=amdgcn--amdhsa -S -O3 -enable-no-infs-fp-math %s | FileCheck -check-prefix=GCN -check-prefix=NOINFS %s
5 ; GCN: define float @foo(float %x) local_unnamed_addr #0 {
6 ; GCN: define amdgpu_kernel void @caller(float addrspace(1)* nocapture %p) local_unnamed_addr #1 {
7 ; GCN: %mul.i = fmul float %load, 1.500000e+01
9 ; UNSAFE: attributes #0 = { norecurse nounwind readnone "less-precise-fpmad"="true" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "unsafe-fp-math"="true" }
10 ; UNSAFE: attributes #1 = { nofree norecurse nounwind "less-precise-fpmad"="true" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "unsafe-fp-math"="true" }
12 ; NOINFS: attributes #0 = { norecurse nounwind readnone "no-infs-fp-math"="true" }
13 ; NOINFS: attributes #1 = { nofree norecurse nounwind "less-precise-fpmad"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="false" "unsafe-fp-math"="false" }
15 ; NONANS: attributes #0 = { norecurse nounwind readnone "no-nans-fp-math"="true" }
16 ; NONANS: attributes #1 = { nofree norecurse nounwind "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="true" "unsafe-fp-math"="false" }
18 define float @foo(float %x) #0 {
20 %mul = fmul float %x, 1.500000e+01
24 define amdgpu_kernel void @caller(float addrspace(1)* %p) #1 {
26 %load = load float, float addrspace(1)* %p, align 4
27 %call = call fast float @foo(float %load) #0
28 store float %call, float addrspace(1)* %p, align 4
32 attributes #0 = { nounwind }
33 attributes #1 = { nounwind "less-precise-fpmad"="true" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "unsafe-fp-math"="true" }