[Mlir-commits] [mlir] a2cdb97 - [mlir][AMDGPU] Set ABI version constant when linking device libs
Krzysztof Drewniak
llvmlistbot at llvm.org
Fri Jun 10 11:41:02 PDT 2022
Author: Krzysztof Drewniak
Date: 2022-06-10T18:40:52Z
New Revision: a2cdb9791bf8085d3e6aee2f86c181b971c4a4e0
URL: https://github.com/llvm/llvm-project/commit/a2cdb9791bf8085d3e6aee2f86c181b971c4a4e0
DIFF: https://github.com/llvm/llvm-project/commit/a2cdb9791bf8085d3e6aee2f86c181b971c4a4e0.diff
LOG: [mlir][AMDGPU] Set ABI version constant when linking device libs
Currently, linking the device libraries requires setting a constant
that indicates the code object ABI version the compilation is
targeting.
This fixes the MLIR linking process by setting this constant to 400,
which is the value corresponding to the current code object ABI
default, version 4.
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/D126913
Added:
Modified:
mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp b/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
index 9c11a509c197c..7f830b73fe44f 100644
--- a/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
+++ b/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
@@ -262,6 +262,10 @@ SerializeToHsacoPass::translateToLLVMIR(llvm::LLVMContext &llvmContext) {
.getZExtValue();
uint32_t isaNumber = minor + 1000 * major;
addControlConstant("__oclc_ISA_version", isaNumber, 32);
+
+ // This constant must always match the default code object ABI version
+ // of the AMDGPU backend.
+ addControlConstant("__oclc_ABI_version", 400, 32);
}
// Determine libraries we need to link - order matters due to dependencies
More information about the Mlir-commits
mailing list