6363// RUN: -ffp-builtin-accuracy=high %s -o - \
6464// RUN: | FileCheck --check-prefix LOW-PREC-DIV %s
6565
66- // RUN: %clang_cc1 %{common_opts_spirv32} -ffp-builtin-accuracy=high:fdiv \
66+ // RUN: %clang_cc1 %{common_opts_spirv32} -ffp-builtin-accuracy=high:div \
6767// RUN: -fno-offload-fp32-prec-div %s -o - \
6868// RUN: | FileCheck --check-prefix ROUNDED-DIV %s
6969
131131// RUN: -ffp-builtin-accuracy=high %s -o - \
132132// RUN: | FileCheck --check-prefix LOW-PREC-DIV %s
133133
134- // RUN: %clang_cc1 %{common_opts_spirv64} -ffp-builtin-accuracy=high:fdiv \
134+ // RUN: %clang_cc1 %{common_opts_spirv64} -ffp-builtin-accuracy=high:div \
135135// RUN: -fno-offload-fp32-prec-div %s -o - \
136136// RUN: | FileCheck --check-prefix ROUNDED-DIV %s
137137
200200// RUN: -ffp-builtin-accuracy=high %s -o - \
201201// RUN: | FileCheck --check-prefix LOW-PREC-DIV %s
202202
203- // RUN: %clang_cc1 %{common_opts_spir} -ffp-builtin-accuracy=high:fdiv \
203+ // RUN: %clang_cc1 %{common_opts_spir} -ffp-builtin-accuracy=high:div \
204204// RUN: -fno-offload-fp32-prec-div %s -o - \
205205// RUN: | FileCheck --check-prefix ROUNDED-DIV %s
206206
268268// RUN: -ffp-builtin-accuracy=high %s -o - \
269269// RUN: | FileCheck --check-prefix LOW-PREC-DIV %s
270270
271- // RUN: %clang_cc1 %{common_opts_spir64} -ffp-builtin-accuracy=high:fdiv \
271+ // RUN: %clang_cc1 %{common_opts_spir64} -ffp-builtin-accuracy=high:div \
272272// RUN: -fno-offload-fp32-prec-div %s -o - \
273273// RUN: | FileCheck --check-prefix ROUNDED-DIV %s
274274
287287#include " sycl.hpp"
288288
289289extern " C" SYCL_EXTERNAL float sqrt (float );
290- extern " C" SYCL_EXTERNAL float fdiv (float , float );
291290
292291using namespace sycl ;
293292
@@ -297,6 +296,7 @@ int main() {
297296 float Value1 = .5f ;
298297 float Value2 = .9f ;
299298 queue deviceQueue;
299+ float *a;
300300
301301 deviceQueue.submit ([&](handler& cgh) {
302302 cgh.parallel_for <class KernelSqrt >(numOfItems,
@@ -322,22 +322,22 @@ int main() {
322322 deviceQueue.submit ([&](handler& cgh) {
323323 cgh.parallel_for <class KernelFdiv >(numOfItems,
324324 [=](id<1 > wiID) {
325- // PREC-SQRT: call spir_func float @fdiv(float noundef {{.*}}, float noundef {{.*}})
326- // ROUNDED-SQRT: call spir_func float @fdiv(float noundef {{.*}}, float noundef {{.*}})
325+ // PREC-SQRT: fdiv float {{.*}}, {{.*}}
326+ // ROUNDED-SQRT: fdiv float {{.*}}, {{.*}}
327327 // ROUNDED-SQRT-FAST: call reassoc nnan ninf nsz arcp afn float @llvm.fpbuiltin.fdiv.f32(float {{.*}}) #[[ATTR_DIV:[0-9]+]]
328- // PREC-DIV: call spir_func float @fdiv(float noundef {{.*}}, float noundef {{.*}})
328+ // PREC-DIV: fdiv float {{.*}}, {{.*}}
329329 // ROUNDED-DIV: call float @llvm.fpbuiltin.fdiv.f32(float {{.*}}, float {{.*}}) #[[ATTR_DIV:[0-9]+]]
330330 // ROUNDED-DIV-FAST: call reassoc nnan ninf nsz arcp afn float @llvm.fpbuiltin.fdiv.f32(float {{.*}}, float {{.*}}) #[[ATTR_DIV:[0-9]+]]
331- // PREC-FAST: call reassoc nnan ninf nsz arcp afn spir_func nofpclass(nan inf) float @fdiv(float noundef nofpclass(nan inf) {{.*}}, float noundef nofpclass(nan inf) {{.*}})
331+ // PREC-FAST: fdiv reassoc nnan ninf nsz arcp afn float {{.*}}, {{.*}}
332332 // ROUNDED-DIV-ROUNDED-SQRT: call float @llvm.fpbuiltin.fdiv.f32(float {{.*}}, float {{.*}}) #[[ATTR_DIV:[0-9]+]]
333333 // PREC-SQRT-FAST: call reassoc nnan ninf nsz arcp afn float @llvm.fpbuiltin.fdiv.f32(float {{.*}}, float {{.*}}) #[[ATTR_DIV:[0-9]+]]
334- // ROUNDED-SQRT-PREC-DIV: call reassoc nnan ninf nsz arcp afn spir_func nofpclass(nan inf) float @fdiv(float noundef nofpclass(nan inf) {{.*}}, float noundef nofpclass(nan inf) {{.*}})
334+ // ROUNDED-SQRT-PREC-DIV: fdiv reassoc nnan ninf nsz arcp afn float {{.*}}, {{.*}}
335335 // ROUNDED-DIV-PREC-SQRT: call reassoc nnan ninf nsz arcp afn float @llvm.fpbuiltin.fdiv.f32(float {{.*}}, float {{.*}}) #[[ATTR_DIV:[0-9]+]]
336336 // ROUNDED-DIV-ROUNDED-SQRT-FAST: call reassoc nnan ninf nsz arcp afn float @llvm.fpbuiltin.fdiv.f32(float {{.*}}, float {{.*}}) #[[ATTR_DIV:[0-9]+]]
337337 // LOW-PREC-DIV: call float @llvm.fpbuiltin.fdiv.f32(float {{.*}}, float {{.*}}) #[[ATTR_FDIV_LOW:[0-9]+]]
338338 // HIGH-PREC: call float @llvm.fpbuiltin.fdiv.f32(float {{.*}}, float {{.*}}) #[[ATTR_FDIV_HIGH:[0-9]+]]
339- // LOW-PREC-SQRT: call float @llvm.fpbuiltin.fdiv.f32(float {{.*}}, float {{.*}}) #[[ATTR_FDIV_LOW:[0-9]+]]
340- ( void ) fdiv (Value1, Value1) ;
339+ // LOW-PREC-SQRT: fdiv float {{.*}}, {{.*}}
340+ a[ 0 ] = Value1 / Value2 ;
341341 });
342342 });
343343
@@ -355,4 +355,3 @@ return 0;
355355// LOW-PREC-DIV: attributes #[[ATTR_FDIV_LOW]] = {{.*}}"fpbuiltin-max-error"="2.5"
356356// HIGH-PREC: attributes #[[ATTR_FDIV_HIGH]] = {{.*}}"fpbuiltin-max-error"="1.0"
357357// LOW-PREC-SQRT: attributes #[[ATTR_SQRT_LOW]] = {{.*}}"fpbuiltin-max-error"="3.0"
358- // LOW-PREC-SQRT: attributes #[[ATTR_FDIV_LOW]] = {{.*}}"fpbuiltin-max-error"="1.0"
0 commit comments