r227315 - R600: Use a Southern Islands GPU as the default for the amdgcn target
Tom Stellard
thomas.stellard at amd.com
Wed Jan 28 07:38:44 PST 2015
Author: tstellar
Date: Wed Jan 28 09:38:44 2015
New Revision: 227315
URL: http://llvm.org/viewvc/llvm-project?rev=227315&view=rev
Log:
R600: Use a Southern Islands GPU as the default for the amdgcn target
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/CodeGen/target-data.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=227315&r1=227314&r2=227315&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Jan 28 09:38:44 2015
@@ -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;
}
Modified: cfe/trunk/test/CodeGen/target-data.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/target-data.c?rev=227315&r1=227314&r2=227315&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/target-data.c (original)
+++ cfe/trunk/test/CodeGen/target-data.c Wed Jan 28 09:38:44 2015
@@ -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"
More information about the cfe-commits
mailing list