8000 Sync rustc_codegen_cranelift by bjorn3 · Pull Request #117124 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Sync rustc_codegen_cranelift #117124

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 12 commits into from
Oct 24, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Simplify FunctionCx::create_stack_slot a bit
  • Loading branch information
bjorn3 committed Oct 22, 2023
commit 56c6c86661498c61a0f877e43c9e6aa928882fa1
8 changes: 1 addition & 7 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,13 +395,7 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> {
} else {
// Alignment is too big to handle using the above hack. Dynamically realign a stack slot
// instead. This wastes some space for the realignment.
let stack_slot = self.bcx.create_sized_stack_slot(StackSlotData {
kind: StackSlotKind::ExplicitSlot,
// FIXME is this calculation to ensure there is enough space to dyanmically realign
// as well as keep a 16 byte realignment for the other stack slots correct?
size: ((size + align - 1) + 16) / 16 * 16,
});
let base_ptr = self.bcx.ins().stack_addr(self.pointer_type, stack_slot, 0);
let base_ptr = self.create_stack_slot(size + align, 16).get_addr(self);
let misalign_offset = self.bcx.ins().urem_imm(base_ptr, i64::from(align));
let realign_offset = self.bcx.ins().irsub_imm(misalign_offset, i64::from(align));
Pointer::new(self.bcx.ins().iadd(base_ptr, realign_offset))
Expand Down
0