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
4-
5- ; GCN: define float @foo(float %x) local_unnamed_addr #0 {
6- ; GCN: define amdgpu_kernel void @caller(ptr addrspace(1) captures(none) %p) local_unnamed_addr #1 {
7- ; GCN: %mul.i = fmul float %load, 1.500000e+01
8-
9- ; UNSAFE: attributes #0 = { nounwind "uniform-work-group-size"="false" "unsafe-fp-math"="true" }
10- ; UNSAFE: attributes #1 = { nounwind "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "uniform-work-group-size"="false" "unsafe-fp-math"="true" }
11-
12- ; NOINFS: attributes #0 = { nounwind "no-infs-fp-math"="true" "uniform-work-group-size"="false" "unsafe-fp-math"="true" }
13- ; NOINFS: attributes #1 = { nounwind "less-precise-fpmad"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="false" "uniform-work-group-size"="false" "unsafe-fp-math"="true" }
14-
15- ; NONANS: attributes #0 = { nounwind "no-nans-fp-math"="true" "uniform-work-group-size"="false" "unsafe-fp-math"="true" }
16- ; NONANS: attributes #1 = { nounwind "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="true" "uniform-work-group-size"="false" "unsafe-fp-math"="true" }
1+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals all --version 5
2+ ; RUN: opt -mtriple=amdgcn-amd-amdhsa -S -O3 -enable-unsafe-fp-math %s | FileCheck --check-prefixes=GCN,UNSAFE %s
3+ ; RUN: opt -mtriple=amdgcn-amd-amdhsa -S -O3 -enable-no-nans-fp-math %s | FileCheck --check-prefixes=GCN,NONANS %s
4+ ; RUN: opt -mtriple=amdgcn-amd-amdhsa -S -O3 -enable-no-infs-fp-math %s | FileCheck --check-prefixes=GCN,NOINFS %s
175
186declare void @extern () #0
197
208define float @foo (float %x ) #0 {
9+ ; GCN-LABEL: define float @foo(
10+ ; GCN-SAME: float [[X:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
11+ ; GCN-NEXT: [[ENTRY:.*:]]
12+ ; GCN-NEXT: tail call void @extern()
13+ ; GCN-NEXT: [[MUL:%.*]] = fmul float [[X]], 1.500000e+01
14+ ; GCN-NEXT: ret float [[MUL]]
15+ ;
2116entry:
2217 call void @extern ()
2318 %mul = fmul float %x , 1 .500000e+01
2419 ret float %mul
2520}
2621
2722define amdgpu_kernel void @caller (ptr addrspace (1 ) %p ) #1 {
23+ ; GCN-LABEL: define amdgpu_kernel void @caller(
24+ ; GCN-SAME: ptr addrspace(1) captures(none) [[P:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] {
25+ ; GCN-NEXT: [[ENTRY:.*:]]
26+ ; GCN-NEXT: [[LOAD:%.*]] = load float, ptr addrspace(1) [[P]], align 4, !amdgpu.noclobber [[META0:![0-9]+]]
27+ ; GCN-NEXT: tail call void @extern()
28+ ; GCN-NEXT: [[MUL_I:%.*]] = fmul float [[LOAD]], 1.500000e+01
29+ ; GCN-NEXT: store float [[MUL_I]], ptr addrspace(1) [[P]], align 4
30+ ; GCN-NEXT: ret void
31+ ;
2832entry:
2933 %load = load float , ptr addrspace (1 ) %p , align 4
3034 %call = call fast float @foo (float %load )
@@ -34,3 +38,24 @@ entry:
3438
3539attributes #0 = { nounwind "uniform-work-group-size" ="false" "unsafe-fp-math" ="true" }
3640attributes #1 = { nounwind "less-precise-fpmad" ="true" "no-infs-fp-math" ="true" "no-nans-fp-math" ="true" "unsafe-fp-math" ="true" }
41+
42+ ;.
43+ ; UNSAFE: attributes #[[ATTR0]] = { nounwind "uniform-work-group-size"="false" "unsafe-fp-math"="true" }
44+ ; UNSAFE: attributes #[[ATTR1]] = { nounwind "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "uniform-work-group-size"="false" "unsafe-fp-math"="true" }
45+ ;.
46+ ; NONANS: attributes #[[ATTR0]] = { nounwind "no-nans-fp-math"="true" "uniform-work-group-size"="false" "unsafe-fp-math"="true" }
47+ ; NONANS: attributes #[[ATTR1]] = { nounwind "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="true" "uniform-work-group-size"="false" "unsafe-fp-math"="true" }
48+ ;.
49+ ; NOINFS: attributes #[[ATTR0]] = { nounwind "no-infs-fp-math"="true" "uniform-work-group-size"="false" "unsafe-fp-math"="true" }
50+ ; NOINFS: attributes #[[ATTR1]] = { nounwind "less-precise-fpmad"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="false" "uniform-work-group-size"="false" "unsafe-fp-math"="true" }
51+ ;.
52+ ; UNSAFE: [[META0]] = !{}
53+ ;.
54+ ; NONANS: [[META0]] = !{}
55+ ;.
56+ ; NOINFS: [[META0]] = !{}
57+ ;.
58+ ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
59+ ; NOINFS: {{.*}}
60+ ; NONANS: {{.*}}
61+ ; UNSAFE: {{.*}}
0 commit comments