[llvm] r326825 - [AMDGPU] Add default ISA version targets
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 6 10:33:55 PST 2018
Author: rampitec
Date: Tue Mar 6 10:33:55 2018
New Revision: 326825
URL: http://llvm.org/viewvc/llvm-project?rev=326825&view=rev
Log:
[AMDGPU] Add default ISA version targets
In case if -mattr used to modify feature set bits in llvm-mc call
getIsaVersion can fail to identify specific ISA due to test mismatch.
Adding default fallback tests which will always correctly report at
least major version.
Differential Revision: https://reviews.llvm.org/D44163
Added:
llvm/trunk/test/MC/AMDGPU/hsa_isa_version_attrs.s
Modified:
llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp?rev=326825&r1=326824&r2=326825&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp Tue Mar 6 10:33:55 2018
@@ -206,6 +206,8 @@ IsaVersion getIsaVersion(const FeatureBi
return {7, 0, 3};
if (Features.test(FeatureISAVersion7_0_4))
return {7, 0, 4};
+ if (Features.test(FeatureSeaIslands))
+ return {7, 0, 0};
// GCN GFX8 (Volcanic Islands (VI)).
if (Features.test(FeatureISAVersion8_0_1))
@@ -216,12 +218,16 @@ IsaVersion getIsaVersion(const FeatureBi
return {8, 0, 3};
if (Features.test(FeatureISAVersion8_1_0))
return {8, 1, 0};
+ if (Features.test(FeatureVolcanicIslands))
+ return {8, 0, 0};
// GCN GFX9.
if (Features.test(FeatureISAVersion9_0_0))
return {9, 0, 0};
if (Features.test(FeatureISAVersion9_0_2))
return {9, 0, 2};
+ if (Features.test(FeatureGFX9))
+ return {9, 0, 0};
if (!Features.test(FeatureGCN) || Features.test(FeatureSouthernIslands))
return {0, 0, 0};
Added: llvm/trunk/test/MC/AMDGPU/hsa_isa_version_attrs.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AMDGPU/hsa_isa_version_attrs.s?rev=326825&view=auto
==============================================================================
--- llvm/trunk/test/MC/AMDGPU/hsa_isa_version_attrs.s (added)
+++ llvm/trunk/test/MC/AMDGPU/hsa_isa_version_attrs.s Tue Mar 6 10:33:55 2018
@@ -0,0 +1,6 @@
+// RUN: llvm-mc -arch=amdgcn -mcpu=gfx801 -mattr=-fast-fmaf -show-encoding %s | FileCheck --check-prefix=GFX8 %s
+// RUN: llvm-mc -arch=amdgcn -mcpu=gfx900 -mattr=-mad-mix-insts -show-encoding %s | FileCheck --check-prefix=GFX9 %s
+
+.hsa_code_object_isa
+// GFX8: .hsa_code_object_isa 8,0,0,"AMD","AMDGPU"
+// GFX9: .hsa_code_object_isa 9,0,0,"AMD","AMDGPU"
More information about the llvm-commits
mailing list