Skip to content

Commit

Permalink
Use size of pointer for offset
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasSte committed Jan 29, 2024
1 parent f481447 commit 0f4d0df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions llvm/lib/Target/SBF/SBFISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ SDValue SBFTargetLowering::LowerFormalArguments(
unsigned Offset;
if (Subtarget->getHasDynamicFrames()) {
// In SBFv2, the arguments are stored on the start of the frame.
Offset = VA.getLocMemOffset() + 8;
Offset = VA.getLocMemOffset() + PtrVT.getFixedSizeInBits() / 8;
} else {
Offset = SBFRegisterInfo::FrameLength - VA.getLocMemOffset();
}
Expand Down Expand Up @@ -614,7 +614,8 @@ SDValue SBFTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
// When dynamic frames are enabled, the frame size is only calculated
// after lowering instructions, so we must place arguments at the start
// of the frame.
int64_t Offset = -(int64_t)VA.getLocMemOffset() - 8;
int64_t Offset =
-(int64_t)VA.getLocMemOffset() - (PtrVT.getFixedSizeInBits() / 8);
int FrameIndex = MF.getFrameInfo().CreateFixedObject(
VA.getLocVT().getFixedSizeInBits() / 8, Offset, false);
DstAddr = DAG.getFrameIndex(FrameIndex, PtrVT);
Expand Down

0 comments on commit 0f4d0df

Please sign in to comment.