summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/MSP430
diff options
context:
space:
mode:
authorMingming Liu <mingmingl@google.com>2025-09-10 15:25:31 -0700
committerGitHub <noreply@github.com>2025-09-10 15:25:31 -0700
commit1417dafa1db9cb1b2b09438aa9f53ea5ab6e36e2 (patch)
tree57f4b1f313c8cf74eed8819870f39c36ea263c68 /llvm/lib/Target/MSP430
parent898b813bc8a6d0276bf0f4769f5f2f64b34e632d (diff)
parentb8cefcb601ddaa18482555c4ff363c01a270c2fe (diff)
Merge branch 'main' into users/mingmingl-llvm/samplefdo-profile-formatusers/mingmingl-llvm/samplefdo-profile-format
Diffstat (limited to 'llvm/lib/Target/MSP430')
-rw-r--r--llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp5
-rw-r--r--llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp11
-rw-r--r--llvm/lib/Target/MSP430/MSP430ISelLowering.cpp24
-rw-r--r--llvm/lib/Target/MSP430/MSP430InstrInfo.cpp7
-rw-r--r--llvm/lib/Target/MSP430/MSP430InstrInfo.h2
5 files changed, 21 insertions, 28 deletions
diff --git a/llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp b/llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp
index 38d22eda5f17..a31c8ec1b2bb 100644
--- a/llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp
+++ b/llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp
@@ -36,7 +36,6 @@ namespace {
/// Parses MSP430 assembly from a stream.
class MSP430AsmParser : public MCTargetAsmParser {
- const MCSubtargetInfo &STI;
MCAsmParser &Parser;
const MCRegisterInfo *MRI;
@@ -79,7 +78,7 @@ class MSP430AsmParser : public MCTargetAsmParser {
public:
MSP430AsmParser(const MCSubtargetInfo &STI, MCAsmParser &Parser,
const MCInstrInfo &MII, const MCTargetOptions &Options)
- : MCTargetAsmParser(Options, STI, MII), STI(STI), Parser(Parser) {
+ : MCTargetAsmParser(Options, STI, MII), Parser(Parser) {
MCAsmParserExtension::Initialize(Parser);
MRI = getContext().getRegisterInfo();
@@ -264,7 +263,7 @@ bool MSP430AsmParser::matchAndEmitInstruction(SMLoc Loc, unsigned &Opcode,
switch (MatchResult) {
case Match_Success:
Inst.setLoc(Loc);
- Out.emitInstruction(Inst, STI);
+ Out.emitInstruction(Inst, *STI);
return false;
case Match_MnemonicFail:
return Error(Loc, "invalid instruction mnemonic");
diff --git a/llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp b/llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp
index c8094a8eeb36..e6666e8cafdf 100644
--- a/llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp
+++ b/llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp
@@ -103,15 +103,6 @@ static DecodeStatus DecodeGR16RegisterClass(MCInst &MI, uint64_t RegNo,
}
static DecodeStatus DecodeCGImm(MCInst &MI, uint64_t Bits, uint64_t Address,
- const MCDisassembler *Decoder);
-
-static DecodeStatus DecodeMemOperand(MCInst &MI, uint64_t Bits,
- uint64_t Address,
- const MCDisassembler *Decoder);
-
-#include "MSP430GenDisassemblerTables.inc"
-
-static DecodeStatus DecodeCGImm(MCInst &MI, uint64_t Bits, uint64_t Address,
const MCDisassembler *Decoder) {
int64_t Imm;
switch (Bits) {
@@ -142,6 +133,8 @@ static DecodeStatus DecodeMemOperand(MCInst &MI, uint64_t Bits,
return MCDisassembler::Success;
}
+#include "MSP430GenDisassemblerTables.inc"
+
enum AddrMode {
amInvalid = 0,
amRegister,
diff --git a/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp b/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
index 6da5e66be4ad..5653099431b1 100644
--- a/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
+++ b/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
@@ -154,9 +154,9 @@ MSP430TargetLowering::MSP430TargetLowering(const TargetMachine &TM,
const RTLIB::LibcallImpl Impl;
} LibraryCalls[] = {
// Integer Multiply - EABI Table 9
- {RTLIB::MUL_I16, RTLIB::__mspabi_mpyi_hw},
- {RTLIB::MUL_I32, RTLIB::__mspabi_mpyl_hw},
- {RTLIB::MUL_I64, RTLIB::__mspabi_mpyll_hw},
+ {RTLIB::MUL_I16, RTLIB::impl___mspabi_mpyi_hw},
+ {RTLIB::MUL_I32, RTLIB::impl___mspabi_mpyl_hw},
+ {RTLIB::MUL_I64, RTLIB::impl___mspabi_mpyll_hw},
// TODO The __mspabi_mpysl*_hw functions ARE implemented in libgcc
// TODO The __mspabi_mpyul*_hw functions ARE implemented in libgcc
};
@@ -169,9 +169,9 @@ MSP430TargetLowering::MSP430TargetLowering(const TargetMachine &TM,
const RTLIB::LibcallImpl Impl;
} LibraryCalls[] = {
// Integer Multiply - EABI Table 9
- {RTLIB::MUL_I16, RTLIB::__mspabi_mpyi_hw},
- {RTLIB::MUL_I32, RTLIB::__mspabi_mpyl_hw32},
- {RTLIB::MUL_I64, RTLIB::__mspabi_mpyll_hw32},
+ {RTLIB::MUL_I16, RTLIB::impl___mspabi_mpyi_hw},
+ {RTLIB::MUL_I32, RTLIB::impl___mspabi_mpyl_hw32},
+ {RTLIB::MUL_I64, RTLIB::impl___mspabi_mpyll_hw32},
// TODO The __mspabi_mpysl*_hw32 functions ARE implemented in libgcc
// TODO The __mspabi_mpyul*_hw32 functions ARE implemented in libgcc
};
@@ -184,9 +184,9 @@ MSP430TargetLowering::MSP430TargetLowering(const TargetMachine &TM,
const RTLIB::LibcallImpl Impl;
} LibraryCalls[] = {
// Integer Multiply - EABI Table 9
- {RTLIB::MUL_I16, RTLIB::__mspabi_mpyi_f5hw},
- {RTLIB::MUL_I32, RTLIB::__mspabi_mpyl_f5hw},
- {RTLIB::MUL_I64, RTLIB::__mspabi_mpyll_f5hw},
+ {RTLIB::MUL_I16, RTLIB::impl___mspabi_mpyi_f5hw},
+ {RTLIB::MUL_I32, RTLIB::impl___mspabi_mpyl_f5hw},
+ {RTLIB::MUL_I64, RTLIB::impl___mspabi_mpyll_f5hw},
// TODO The __mspabi_mpysl*_f5hw functions ARE implemented in libgcc
// TODO The __mspabi_mpyul*_f5hw functions ARE implemented in libgcc
};
@@ -199,9 +199,9 @@ MSP430TargetLowering::MSP430TargetLowering(const TargetMachine &TM,
const RTLIB::LibcallImpl Impl;
} LibraryCalls[] = {
// Integer Multiply - EABI Table 9
- {RTLIB::MUL_I16, RTLIB::__mspabi_mpyi},
- {RTLIB::MUL_I32, RTLIB::__mspabi_mpyl},
- {RTLIB::MUL_I64, RTLIB::__mspabi_mpyll},
+ {RTLIB::MUL_I16, RTLIB::impl___mspabi_mpyi},
+ {RTLIB::MUL_I32, RTLIB::impl___mspabi_mpyl},
+ {RTLIB::MUL_I64, RTLIB::impl___mspabi_mpyll},
// The __mspabi_mpysl* functions are NOT implemented in libgcc
// The __mspabi_mpyul* functions are NOT implemented in libgcc
};
diff --git a/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp b/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
index 8bc6387e6a7e..65b4820752c9 100644
--- a/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
+++ b/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
@@ -12,6 +12,7 @@
#include "MSP430InstrInfo.h"
#include "MSP430.h"
+#include "MSP430Subtarget.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/Support/ErrorHandling.h"
@@ -24,9 +25,9 @@ using namespace llvm;
// Pin the vtable to this file.
void MSP430InstrInfo::anchor() {}
-MSP430InstrInfo::MSP430InstrInfo(MSP430Subtarget &STI)
- : MSP430GenInstrInfo(MSP430::ADJCALLSTACKDOWN, MSP430::ADJCALLSTACKUP),
- RI() {}
+MSP430InstrInfo::MSP430InstrInfo(const MSP430Subtarget &STI)
+ : MSP430GenInstrInfo(STI, MSP430::ADJCALLSTACKDOWN, MSP430::ADJCALLSTACKUP),
+ RI() {}
void MSP430InstrInfo::storeRegToStackSlot(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register SrcReg,
diff --git a/llvm/lib/Target/MSP430/MSP430InstrInfo.h b/llvm/lib/Target/MSP430/MSP430InstrInfo.h
index 58be64336f26..316c136890bf 100644
--- a/llvm/lib/Target/MSP430/MSP430InstrInfo.h
+++ b/llvm/lib/Target/MSP430/MSP430InstrInfo.h
@@ -27,7 +27,7 @@ class MSP430InstrInfo : public MSP430GenInstrInfo {
const MSP430RegisterInfo RI;
virtual void anchor();
public:
- explicit MSP430InstrInfo(MSP430Subtarget &STI);
+ explicit MSP430InstrInfo(const MSP430Subtarget &STI);
/// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
/// such, whenever a client has an instance of instruction info, it should