forked from OSchip/llvm-project
[clang][amdgpu] Prefer not using `fp16` conversion intrinsics.
Reviewers: yaxunl, arsenm Subscribers: kzhuravl, jvesely, wdng, nhaehnle, dstuttard, tpr, t-tye, kerbowa, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D81849
This commit is contained in:
parent
14b947f306
commit
e830fa260d
|
@ -219,6 +219,8 @@ public:
|
||||||
|
|
||||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override;
|
ArrayRef<Builtin::Info> getTargetBuiltins() const override;
|
||||||
|
|
||||||
|
bool useFP16ConversionIntrinsics() const override { return false; }
|
||||||
|
|
||||||
void getTargetDefines(const LangOptions &Opts,
|
void getTargetDefines(const LangOptions &Opts,
|
||||||
MacroBuilder &Builder) const override;
|
MacroBuilder &Builder) const override;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
// REQUIRES: amdgpu-registered-target
|
||||||
|
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -emit-llvm -fcuda-is-device -o - %s | FileCheck %s
|
||||||
|
|
||||||
|
#define __device__ __attribute__((device))
|
||||||
|
|
||||||
|
// CHECK-LABEL: @_Z2d0DF16_
|
||||||
|
// CHECK: fpext
|
||||||
|
__device__ float d0(_Float16 x) {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
// CHECK-LABEL: @_Z2d1f
|
||||||
|
// CHECK: fptrunc
|
||||||
|
__device__ _Float16 d1(float x) {
|
||||||
|
return x;
|
||||||
|
}
|
Loading…
Reference in New Issue