Skip to content

[RISCV] Use TypeSize instead of uint64_t in getMachineMemOperand interface #133274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions llvm/include/llvm/CodeGen/MachineFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ class LLVM_ABI MachineFunction {
AtomicOrdering Ordering = AtomicOrdering::NotAtomic,
AtomicOrdering FailureOrdering = AtomicOrdering::NotAtomic);
MachineMemOperand *getMachineMemOperand(
MachinePointerInfo PtrInfo, MachineMemOperand::Flags F, uint64_t Size,
MachinePointerInfo PtrInfo, MachineMemOperand::Flags F, TypeSize Size,
Align BaseAlignment, const AAMDNodes &AAInfo = AAMDNodes(),
const MDNode *Ranges = nullptr, SyncScope::ID SSID = SyncScope::System,
AtomicOrdering Ordering = AtomicOrdering::NotAtomic,
Expand All @@ -1099,7 +1099,7 @@ class LLVM_ABI MachineFunction {
: LLT::scalar(8 * Size.getValue().getKnownMinValue()));
}
MachineMemOperand *getMachineMemOperand(const MachineMemOperand *MMO,
int64_t Offset, uint64_t Size) {
int64_t Offset, TypeSize Size) {
return getMachineMemOperand(MMO, Offset, LocationSize::precise(Size));
}

Expand All @@ -1115,7 +1115,7 @@ class LLVM_ABI MachineFunction {
LLT Ty);
MachineMemOperand *getMachineMemOperand(const MachineMemOperand *MMO,
const MachinePointerInfo &PtrInfo,
uint64_t Size) {
TypeSize Size) {
return getMachineMemOperand(MMO, PtrInfo, LocationSize::precise(Size));
}

Expand Down
8 changes: 2 additions & 6 deletions llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,11 +705,9 @@ void RISCVInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
llvm_unreachable("Can't store this register to stack slot");

if (IsScalableVector) {
LocationSize LocSize =
LocationSize::precise(TypeSize::getScalable(MFI.getObjectSize(FI)));
MachineMemOperand *MMO = MF->getMachineMemOperand(
MachinePointerInfo::getFixedStack(*MF, FI), MachineMemOperand::MOStore,
LocSize, MFI.getObjectAlign(FI));
TypeSize::getScalable(MFI.getObjectSize(FI)), MFI.getObjectAlign(FI));

MFI.setStackID(FI, TargetStackID::ScalableVector);
BuildMI(MBB, I, DebugLoc(), get(Opcode))
Expand Down Expand Up @@ -799,11 +797,9 @@ void RISCVInstrInfo::loadRegFromStackSlot(
llvm_unreachable("Can't load this register from stack slot");

if (IsScalableVector) {
LocationSize LocSize =
LocationSize::precise(TypeSize::getScalable(MFI.getObjectSize(FI)));
MachineMemOperand *MMO = MF->getMachineMemOperand(
MachinePointerInfo::getFixedStack(*MF, FI), MachineMemOperand::MOLoad,
LocSize, MFI.getObjectAlign(FI));
TypeSize::getScalable(MFI.getObjectSize(FI)), MFI.getObjectAlign(FI));

MFI.setStackID(FI, TargetStackID::ScalableVector);
BuildMI(MBB, I, DL, get(Opcode), DstReg)
Expand Down