From 8f60c315a30c9cb0050eb86294aed79f350bde7a Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Sat, 22 Jun 2019 01:30:00 +0000 Subject: [PATCH] AMDGPU: Fix target builtins for gfx10 This wasn't setting some of the features from older generations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364123 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/Targets/AMDGPU.cpp | 2 ++ test/CodeGenOpenCL/amdgpu-features.cl | 6 +++--- test/CodeGenOpenCL/builtins-amdgcn-ci.cl | 1 + test/CodeGenOpenCL/builtins-amdgcn-dl-insts-err-clamp.cl | 1 + test/CodeGenOpenCL/builtins-amdgcn-dl-insts-err.cl | 1 + test/CodeGenOpenCL/builtins-amdgcn-dl-insts.cl | 2 ++ test/CodeGenOpenCL/builtins-amdgcn-gfx9.cl | 1 + test/CodeGenOpenCL/builtins-amdgcn-vi.cl | 3 +++ 8 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/Basic/Targets/AMDGPU.cpp b/lib/Basic/Targets/AMDGPU.cpp index 52012f7711..568f267785 100644 --- a/lib/Basic/Targets/AMDGPU.cpp +++ b/lib/Basic/Targets/AMDGPU.cpp @@ -144,8 +144,10 @@ bool AMDGPUTargetInfo::initFeatureMap( LLVM_FALLTHROUGH; case GK_GFX1010: Features["dl-insts"] = true; + Features["ci-insts"] = true; Features["16-bit-insts"] = true; Features["dpp"] = true; + Features["gfx8-insts"] = true; Features["gfx9-insts"] = true; Features["gfx10-insts"] = true; Features["s-memrealtime"] = true; diff --git a/test/CodeGenOpenCL/amdgpu-features.cl b/test/CodeGenOpenCL/amdgpu-features.cl index 1e69685db5..e963aed6f7 100644 --- a/test/CodeGenOpenCL/amdgpu-features.cl +++ b/test/CodeGenOpenCL/amdgpu-features.cl @@ -15,9 +15,9 @@ // GFX904: "target-features"="+16-bit-insts,+ci-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx8-insts,+gfx9-insts,+s-memrealtime" // GFX906: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx8-insts,+gfx9-insts,+s-memrealtime" -// GFX1010: "target-features"="+16-bit-insts,+dl-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx10-insts,+gfx9-insts,+s-memrealtime" -// GFX1011: "target-features"="+16-bit-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx10-insts,+gfx9-insts,+s-memrealtime" -// GFX1012: "target-features"="+16-bit-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx10-insts,+gfx9-insts,+s-memrealtime" +// GFX1010: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime" +// GFX1011: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime" +// GFX1012: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime" // GFX801: "target-features"="+16-bit-insts,+ci-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx8-insts,+s-memrealtime" // GFX700: "target-features"="+ci-insts,+fp64-fp16-denormals,-fp32-denormals" // GFX600: "target-features"="+fp64-fp16-denormals,-fp32-denormals" diff --git a/test/CodeGenOpenCL/builtins-amdgcn-ci.cl b/test/CodeGenOpenCL/builtins-amdgcn-ci.cl index 3045225e10..f6fcfa5830 100644 --- a/test/CodeGenOpenCL/builtins-amdgcn-ci.cl +++ b/test/CodeGenOpenCL/builtins-amdgcn-ci.cl @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu hawaii -S -emit-llvm -o - %s | FileCheck %s // RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu fiji -S -emit-llvm -o - %s | FileCheck %s // RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx906 -S -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1010 -S -emit-llvm -o - %s | FileCheck %s typedef unsigned int uint; diff --git a/test/CodeGenOpenCL/builtins-amdgcn-dl-insts-err-clamp.cl b/test/CodeGenOpenCL/builtins-amdgcn-dl-insts-err-clamp.cl index f8356feb51..d056f02d24 100644 --- a/test/CodeGenOpenCL/builtins-amdgcn-dl-insts-err-clamp.cl +++ b/test/CodeGenOpenCL/builtins-amdgcn-dl-insts-err-clamp.cl @@ -1,6 +1,7 @@ // REQUIRES: amdgpu-registered-target // RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx906 -verify -S -emit-llvm -o - %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1010 -verify -S -emit-llvm -o - %s typedef unsigned int uint; typedef half __attribute__((ext_vector_type(2))) half2; diff --git a/test/CodeGenOpenCL/builtins-amdgcn-dl-insts-err.cl b/test/CodeGenOpenCL/builtins-amdgcn-dl-insts-err.cl index a82fcbd758..cb83c0b48c 100644 --- a/test/CodeGenOpenCL/builtins-amdgcn-dl-insts-err.cl +++ b/test/CodeGenOpenCL/builtins-amdgcn-dl-insts-err.cl @@ -1,6 +1,7 @@ // REQUIRES: amdgpu-registered-target // RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx900 -verify -S -emit-llvm -o - %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1010 -verify -S -emit-llvm -o - %s typedef unsigned int uint; typedef half __attribute__((ext_vector_type(2))) half2; diff --git a/test/CodeGenOpenCL/builtins-amdgcn-dl-insts.cl b/test/CodeGenOpenCL/builtins-amdgcn-dl-insts.cl index e5633fb8f4..a7d635a6d7 100644 --- a/test/CodeGenOpenCL/builtins-amdgcn-dl-insts.cl +++ b/test/CodeGenOpenCL/builtins-amdgcn-dl-insts.cl @@ -1,6 +1,8 @@ // REQUIRES: amdgpu-registered-target // RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx906 -S -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1011 -S -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1012 -S -emit-llvm -o - %s | FileCheck %s typedef unsigned int uint; typedef half __attribute__((ext_vector_type(2))) half2; diff --git a/test/CodeGenOpenCL/builtins-amdgcn-gfx9.cl b/test/CodeGenOpenCL/builtins-amdgcn-gfx9.cl index 333b610f81..344af2b276 100644 --- a/test/CodeGenOpenCL/builtins-amdgcn-gfx9.cl +++ b/test/CodeGenOpenCL/builtins-amdgcn-gfx9.cl @@ -1,5 +1,6 @@ // REQUIRES: amdgpu-registered-target // RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx900 -S -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1010 -S -emit-llvm -o - %s | FileCheck %s #pragma OPENCL EXTENSION cl_khr_fp16 : enable diff --git a/test/CodeGenOpenCL/builtins-amdgcn-vi.cl b/test/CodeGenOpenCL/builtins-amdgcn-vi.cl index 2201421224..e3e6b81271 100644 --- a/test/CodeGenOpenCL/builtins-amdgcn-vi.cl +++ b/test/CodeGenOpenCL/builtins-amdgcn-vi.cl @@ -1,5 +1,8 @@ // REQUIRES: amdgpu-registered-target // RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu tonga -S -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx900 -S -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1010 -S -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1012 -S -emit-llvm -o - %s | FileCheck %s #pragma OPENCL EXTENSION cl_khr_fp16 : enable -- 2.40.0