From d99fb956a3c8554a6701d52e1e78f60c21155011 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 28 Jan 2015 15:38:44 +0000 Subject: [PATCH] R600: Use a Southern Islands GPU as the default for the amdgcn target llvm-svn: 227315 --- clang/lib/Basic/Targets.cpp | 11 +++++++++-- clang/test/CodeGen/target-data.c | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 2030e38..3443ec9 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -1597,8 +1597,15 @@ class R600TargetInfo : public TargetInfo { public: R600TargetInfo(const llvm::Triple &Triple) - : TargetInfo(Triple), GPU(GK_R600) { - DescriptionString = DescriptionStringR600; + : TargetInfo(Triple) { + + if (Triple.getArch() == llvm::Triple::amdgcn) { + DescriptionString = DescriptionStringSI; + GPU = GK_SOUTHERN_ISLANDS; + } else { + DescriptionString = DescriptionStringR600; + GPU = GK_R600; + } AddrSpaceMap = &R600AddrSpaceMap; UseAddrSpaceMapMangling = true; } diff --git a/clang/test/CodeGen/target-data.c b/clang/test/CodeGen/target-data.c index d8e77c5..2f1c971 100644 --- a/clang/test/CodeGen/target-data.c +++ b/clang/test/CodeGen/target-data.c @@ -122,6 +122,11 @@ // RUN: | FileCheck %s -check-prefix=R600SI // R600SI: target datalayout = "e-p:32:32-p1:64:64-p2:64:64-p3:32:32-p4:64:64-p5:32:32-p24:64:64-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64" +// Test default -target-cpu +// RUN: %clang_cc1 -triple amdgcn-unknown -o - -emit-llvm %s \ +// RUN: | FileCheck %s -check-prefix=R600SIDefault +// R600SIDefault: target datalayout = "e-p:32:32-p1:64:64-p2:64:64-p3:32:32-p4:64:64-p5:32:32-p24:64:64-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64" + // RUN: %clang_cc1 -triple arm64-unknown -o - -emit-llvm %s | \ // RUN: FileCheck %s -check-prefix=AARCH64 // AARCH64: target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128" -- 2.7.4