[llvm] 6e93e37 - [MC] Remove unneeded MC*AsmBackend::fixupNeedsRelaxation overrides
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 1 13:54:13 PDT 2024
Author: Fangrui Song
Date: 2024-07-01T13:54:08-07:00
New Revision: 6e93e37fe917833ad2d4d09ceda150ffe755b03e
URL: https://github.com/llvm/llvm-project/commit/6e93e37fe917833ad2d4d09ceda150ffe755b03e
DIFF: https://github.com/llvm/llvm-project/commit/6e93e37fe917833ad2d4d09ceda150ffe755b03e.diff
LOG: [MC] Remove unneeded MC*AsmBackend::fixupNeedsRelaxation overrides
Follow-up to 88c0a8258800bbc72e7c0b0586436d4a1c62a260
("[MC] Make MCAsmBackend::fixupNeedsRelaxation not pure virtual").
Added:
Modified:
llvm/lib/Target/DirectX/MCTargetDesc/DirectXMCTargetDesc.cpp
llvm/lib/Target/Lanai/MCTargetDesc/LanaiAsmBackend.cpp
llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVAsmBackend.cpp
llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp
llvm/lib/Target/VE/MCTargetDesc/VEAsmBackend.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/DirectX/MCTargetDesc/DirectXMCTargetDesc.cpp b/llvm/lib/Target/DirectX/MCTargetDesc/DirectXMCTargetDesc.cpp
index 4a73cbbea3fcc..5a64bf6482d5e 100644
--- a/llvm/lib/Target/DirectX/MCTargetDesc/DirectXMCTargetDesc.cpp
+++ b/llvm/lib/Target/DirectX/MCTargetDesc/DirectXMCTargetDesc.cpp
@@ -92,12 +92,6 @@ class DXILAsmBackend : public MCAsmBackend {
const MCSubtargetInfo *STI) const override {
return true;
}
-
- bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,
- const MCRelaxableFragment *DF,
- const MCAsmLayout &Layout) const override {
- return true;
- }
};
class DirectXMCAsmInfo : public MCAsmInfo {
diff --git a/llvm/lib/Target/Lanai/MCTargetDesc/LanaiAsmBackend.cpp b/llvm/lib/Target/Lanai/MCTargetDesc/LanaiAsmBackend.cpp
index 08ca577a47852..cdcf8d5394363 100644
--- a/llvm/lib/Target/Lanai/MCTargetDesc/LanaiAsmBackend.cpp
+++ b/llvm/lib/Target/Lanai/MCTargetDesc/LanaiAsmBackend.cpp
@@ -56,13 +56,6 @@ class LanaiAsmBackend : public MCAsmBackend {
std::unique_ptr<MCObjectTargetWriter>
createObjectTargetWriter() const override;
- // No instruction requires relaxation
- bool fixupNeedsRelaxation(const MCFixup & /*Fixup*/, uint64_t /*Value*/,
- const MCRelaxableFragment * /*DF*/,
- const MCAsmLayout & /*Layout*/) const override {
- return false;
- }
-
const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const override;
unsigned getNumFixupKinds() const override {
diff --git a/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVAsmBackend.cpp b/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVAsmBackend.cpp
index 1b80e4b9277bd..4c19ebf1f0604 100644
--- a/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVAsmBackend.cpp
+++ b/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVAsmBackend.cpp
@@ -30,13 +30,6 @@ class SPIRVAsmBackend : public MCAsmBackend {
return createSPIRVObjectTargetWriter();
}
- // No instruction requires relaxation.
- bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,
- const MCRelaxableFragment *DF,
- const MCAsmLayout &Layout) const override {
- return false;
- }
-
unsigned getNumFixupKinds() const override { return 1; }
bool mayNeedRelaxation(const MCInst &Inst,
diff --git a/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp b/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp
index cb7414fddd29f..81c943ca47bf8 100644
--- a/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp
+++ b/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp
@@ -305,16 +305,6 @@ namespace {
}
}
- /// fixupNeedsRelaxation - Target specific predicate for whether a given
- /// fixup requires the associated instruction to be relaxed.
- bool fixupNeedsRelaxation(const MCFixup &Fixup,
- uint64_t Value,
- const MCRelaxableFragment *DF,
- const MCAsmLayout &Layout) const override {
- // FIXME.
- llvm_unreachable("fixupNeedsRelaxation() unimplemented");
- return false;
- }
void relaxInstruction(MCInst &Inst,
const MCSubtargetInfo &STI) const override {
// FIXME.
diff --git a/llvm/lib/Target/VE/MCTargetDesc/VEAsmBackend.cpp b/llvm/lib/Target/VE/MCTargetDesc/VEAsmBackend.cpp
index 05f7c00bdc14f..f06a2ab71f241 100644
--- a/llvm/lib/Target/VE/MCTargetDesc/VEAsmBackend.cpp
+++ b/llvm/lib/Target/VE/MCTargetDesc/VEAsmBackend.cpp
@@ -153,16 +153,6 @@ class VEAsmBackend : public MCAsmBackend {
return false;
}
- /// fixupNeedsRelaxation - Target specific predicate for whether a given
- /// fixup requires the associated instruction to be relaxed.
- bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,
- const MCRelaxableFragment *DF,
- const MCAsmLayout &Layout) const override {
- // Not implemented yet. For example, if we have a branch with
- // lager than SIMM32 immediate value, we want to relaxation such
- // branch instructions.
- return false;
- }
void relaxInstruction(MCInst &Inst,
const MCSubtargetInfo &STI) const override {
// Aurora VE doesn't support relaxInstruction yet.
More information about the llvm-commits
mailing list