summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/TargetParser.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-03-17 21:31:35 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2019-03-17 21:31:35 +0000
commite0c1f9e76d595bbcbd0686d762cd8cc2eed3c7e9 (patch)
treeb0f801088db9a35aed25d0e7199c2eec1e95eb6c /llvm/lib/Support/TargetParser.cpp
parent5e7b62de0560ba0f68dd395a08326d30a26f156a (diff)
downloadbcm5719-llvm-e0c1f9e76d595bbcbd0686d762cd8cc2eed3c7e9.tar.gz
bcm5719-llvm-e0c1f9e76d595bbcbd0686d762cd8cc2eed3c7e9.zip
AMDGPU: Partially fix default device for HSA
There are a few different issues, mostly stemming from using generation based checks for anything instead of subtarget features. Stop adding flat-address-space as a feature for HSA, as it should only be a device property. This was incorrectly allowing flat instructions to select for SI. Increase the default generation for HSA to avoid the encoding error when emitting objects. This has some other side effects from various checks which probably should be separate subtarget features (in the cost model and for dealing with the DS offset folding issue). Partial fix for bug 41070. It should probably be an error to try using amdhsa without flat support. llvm-svn: 356347
Diffstat (limited to 'llvm/lib/Support/TargetParser.cpp')
-rw-r--r--llvm/lib/Support/TargetParser.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Support/TargetParser.cpp b/llvm/lib/Support/TargetParser.cpp
index 76401ac0a85..59e096b4b2c 100644
--- a/llvm/lib/Support/TargetParser.cpp
+++ b/llvm/lib/Support/TargetParser.cpp
@@ -169,12 +169,14 @@ void AMDGPU::fillValidArchListR600(SmallVectorImpl<StringRef> &Values) {
}
AMDGPU::IsaVersion AMDGPU::getIsaVersion(StringRef GPU) {
- if (GPU == "generic")
- return {7, 0, 0};
-
AMDGPU::GPUKind AK = parseArchAMDGCN(GPU);
- if (AK == AMDGPU::GPUKind::GK_NONE)
+ if (AK == AMDGPU::GPUKind::GK_NONE) {
+ if (GPU == "generic-hsa")
+ return {7, 0, 0};
+ if (GPU == "generic")
+ return {6, 0, 0};
return {0, 0, 0};
+ }
switch (AK) {
case GK_GFX600: return {6, 0, 0};
OpenPOWER on IntegriCloud