summaryrefslogtreecommitdiff
path: root/openmp
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2023-05-10 14:11:50 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2023-05-10 14:12:39 -0500
commitb09953a4a3ef70fdfb58503b3301d4441045c86b (patch)
tree81136480443d7c9f2dc219e966492c629ca65343 /openmp
parentd878603f24c578773d9cf5f8bfb105877d60f616 (diff)
downloadllvm-b09953a4a3ef70fdfb58503b3301d4441045c86b.tar.gz
[Libomptarget] Fix AMDGPU Note handling after D150022
Summary: The changes in https://reviews.llvm.org/D150022 changed the API for this function that we query. Simply pass in the alignment from the associated header to fix.
Diffstat (limited to 'openmp')
-rw-r--r--openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h6
-rw-r--r--openmp/libomptarget/plugins/amdgpu/impl/system.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h b/openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h
index cdf1d10980e9..ba2262a59b60 100644
--- a/openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h
+++ b/openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h
@@ -160,13 +160,13 @@ public:
/// Process ELF note to read AMDGPU metadata from respective information
/// fields.
- Error processNote(const object::ELF64LE::Note &Note) {
+ Error processNote(const object::ELF64LE::Note &Note, size_t Align) {
if (Note.getName() != "AMDGPU")
return Error::success(); // We are not interested in other things
assert(Note.getType() == ELF::NT_AMDGPU_METADATA &&
"Parse AMDGPU MetaData");
- auto Desc = Note.getDesc();
+ auto Desc = Note.getDesc(Align);
StringRef MsgPackString =
StringRef(reinterpret_cast<const char *>(Desc.data()), Desc.size());
msgpack::Document MsgPackDoc;
@@ -313,7 +313,7 @@ Error readAMDGPUMetaDataFromImage(MemoryBufferRef MemBuffer,
if (Err)
return Err;
// Fills the KernelInfoTabel entries in the reader
- if ((Err = Reader.processNote(N)))
+ if ((Err = Reader.processNote(N, S.sh_addralign)))
return Err;
}
}
diff --git a/openmp/libomptarget/plugins/amdgpu/impl/system.cpp b/openmp/libomptarget/plugins/amdgpu/impl/system.cpp
index e8dba47b6cde..a678bad55e2d 100644
--- a/openmp/libomptarget/plugins/amdgpu/impl/system.cpp
+++ b/openmp/libomptarget/plugins/amdgpu/impl/system.cpp
@@ -197,7 +197,7 @@ findMetadata(const ELFObjectFile<ELF64LE> &ELFObj) {
if (Note.getType() == NT_AMDGPU_METADATA && Note.getName() != "AMDGPU")
return Failure;
- ArrayRef<uint8_t> Desc = Note.getDesc();
+ ArrayRef<uint8_t> Desc = Note.getDesc(Phdr.p_align);
return {Desc.data(), Desc.data() + Desc.size()};
}