[llvm] [MC] Fix HIP buildbot errors after 68472a3 (PR #141138)
via llvm-commits
llvm-commits at lists.llvm.org
Thu May 22 13:47:53 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-amdgpu
Author: Jan Patrick Lehr (jplehr)
<details>
<summary>Changes</summary>
This fixes the errors on our HIP-Kokkos buildbot after 68472a39a0fbf38f5da7bb4ebe43e2ca87ff8308.
I do not know if this is the actually right fix, but afaict it restores the behavior for AMDGPU before the mentioned patch.
---
Full diff: https://github.com/llvm/llvm-project/pull/141138.diff
1 Files Affected:
- (modified) llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp (+10)
``````````diff
diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
index 19e394e5bc38c..0c98c32c21c2c 100644
--- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
+++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
@@ -18,6 +18,7 @@
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSubtargetInfo.h"
+#include "llvm/MC/MCValue.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/EndianStream.h"
#include "llvm/TargetParser/TargetParser.h"
@@ -51,6 +52,8 @@ class AMDGPUAsmBackend : public MCAsmBackend {
std::optional<MCFixupKind> getFixupKind(StringRef Name) const override;
MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const override;
+ bool shouldForceRelocation(const MCAssembler &, const MCFixup &,
+ const MCValue &, const MCSubtargetInfo *) override;
};
} //End anonymous namespace
@@ -189,6 +192,13 @@ MCFixupKindInfo AMDGPUAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
return Infos[Kind - FirstTargetFixupKind];
}
+bool AMDGPUAsmBackend::shouldForceRelocation(const MCAssembler &,
+ const MCFixup &,
+ const MCValue &Target,
+ const MCSubtargetInfo *) {
+ return Target.getSpecifier();
+}
+
unsigned AMDGPUAsmBackend::getMinimumNopSize() const {
return 4;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/141138
More information about the llvm-commits
mailing list