[PATCH] D95638: AMDGPU: Add target id and code object v4 support
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 29 18:23:28 PST 2021
MaskRay added inline comments.
================
Comment at: lld/ELF/Arch/AMDGPU.cpp:17
using namespace llvm;
using namespace llvm::object;
using namespace llvm::support::endian;
----------------
Consider posting lld/ELF changes separately. It is loosely related to the main change.
================
Comment at: lld/ELF/Arch/AMDGPU.cpp:47
+static uint8_t getAbiVersion(InputFile *file) {
+ return cast<ObjFile<ELF64LE>>(file)->getObj().getHeader().e_ident[EI_ABIVERSION];
----------------
Delete this helper - it is only used once.
================
Comment at: lld/ELF/Arch/AMDGPU.cpp:55
-uint32_t AMDGPU::calcEFlags() const {
- assert(!objectFiles.empty());
+static uint32_t getMach(InputFile *file) {
+ return getEFlags(file) & EF_AMDGPU_MACH;
----------------
Delete
================
Comment at: lld/ELF/Arch/AMDGPU.cpp:59
+
+static uint32_t getXnackV4(InputFile *file) {
+ return getEFlags(file) & EF_AMDGPU_FEATURE_XNACK_V4;
----------------
Delete
================
Comment at: lld/ELF/Arch/AMDGPU.cpp:63
+
+static uint32_t getSramEccV4(InputFile *file) {
+ return getEFlags(file) & EF_AMDGPU_FEATURE_SRAMECC_V4;
----------------
Delete
================
Comment at: lld/ELF/Arch/AMDGPU.cpp:101
+ } else {
+ if (retXnack == EF_AMDGPU_FEATURE_XNACK_ANY_V4) {
+ retXnack = getXnackV4(f);
----------------
delete braces around simple statements
================
Comment at: lld/ELF/Arch/AMDGPU.cpp:106
+
+ if ((retSramEcc == EF_AMDGPU_FEATURE_SRAMECC_UNSUPPORTED_V4) ||
+ (retSramEcc != EF_AMDGPU_FEATURE_SRAMECC_ANY_V4 &&
----------------
delete parens
================
Comment at: lld/ELF/Arch/AMDGPU.cpp:115
+ if (retSramEcc == EF_AMDGPU_FEATURE_SRAMECC_ANY_V4) {
+ retSramEcc = getSramEccV4(f);
+ }
----------------
delete braces
================
Comment at: lld/ELF/Arch/AMDGPU.cpp:132
+ default:
+ llvm_unreachable("Unknown ABI Version");
+ }
----------------
If the value is possible (malformed input), use `error` instead of unreachable
don't capitalize messages
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95638/new/
https://reviews.llvm.org/D95638
More information about the llvm-commits
mailing list