diff options
| author | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-08-09 19:43:38 +0000 |
|---|---|---|
| committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-08-09 19:43:38 +0000 |
| commit | 2c17e82bc7b5e812a54cf7eb3a039a2f90bcde28 (patch) | |
| tree | ed48514c4289464a7c363b75df188d296633d11b /clang/test/CodeGenOpenCL/denorms-are-zero.cl | |
| parent | a814d89b6156ecd0f8e0256be09bc795389e0909 (diff) | |
| download | bcm5719-llvm-2c17e82bc7b5e812a54cf7eb3a039a2f90bcde28.tar.gz bcm5719-llvm-2c17e82bc7b5e812a54cf7eb3a039a2f90bcde28.zip | |
[OpenCL][AMDGPU] Add support for -cl-denorms-are-zero
Adjust target features for amdgcn target when -cl-denorms-are-zero is set.
Denormal support is controlled by feature strings fp32-denormals fp64-denormals in amdgcn target. If -cl-denorms-are-zero is not set and the command line does not set fp32/64-denormals feature string, +fp32-denormals +fp64-denormals will be on for GPU's supporting them.
A new virtual function virtual void TargetInfo::adjustTargetOptions(const CodeGenOptions &CGOpts, TargetOptions &TargetOpts) const is introduced to allow adjusting target option by codegen option.
Differential Revision: https://reviews.llvm.org/D22815
llvm-svn: 278151
Diffstat (limited to 'clang/test/CodeGenOpenCL/denorms-are-zero.cl')
| -rw-r--r-- | clang/test/CodeGenOpenCL/denorms-are-zero.cl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/test/CodeGenOpenCL/denorms-are-zero.cl b/clang/test/CodeGenOpenCL/denorms-are-zero.cl index 488004fa4fc..42627303afa 100644 --- a/clang/test/CodeGenOpenCL/denorms-are-zero.cl +++ b/clang/test/CodeGenOpenCL/denorms-are-zero.cl @@ -1,5 +1,13 @@ // RUN: %clang_cc1 -S -cl-denorms-are-zero -o - %s 2>&1 +// RUN: %clang_cc1 -emit-llvm -cl-denorms-are-zero -o - -triple amdgcn--amdhsa -target-cpu fiji %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -o - -triple amdgcn--amdhsa -target-cpu fiji %s | FileCheck %s --check-prefix=CHECK-DENORM -// This test just checks that the -cl-denorms-are-zero argument is accepted +// For non-amdgcn targets, this test just checks that the -cl-denorms-are-zero argument is accepted // by clang. This option is currently a no-op, which is allowed by the // OpenCL specification. + +// CHECK-DENORM-LABEL: define void @f() +// CHECK-DENORM: attributes #{{[0-9]*}} = {{{[^}]*}} "target-features"="{{[^"]*}}+fp32-denormals,+fp64-denormals{{[^"]*}}" +// CHECK-LABEL: define void @f() +// CHECK-NOT: attributes #{{[0-9]*}} = {{{[^}]*}} "target-features"="{{[^"]*}}+fp32-denormals,+fp64-denormals{{[^"]*}}" +void f() {} |

