MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / expand_stack_load

Function expand_stack_load

cranelift/codegen/src/legalizer/mod.rs:239–262  ·  view source on GitHub ↗
(
    isa: &dyn TargetIsa,
    func: &mut ir::Function,
    inst: ir::Inst,
    stack_slot: ir::StackSlot,
    offset: ir::immediates::Offset32,
)

Source from the content-addressed store, hash-verified

237}
238
239fn expand_stack_load(
240 isa: &dyn TargetIsa,
241 func: &mut ir::Function,
242 inst: ir::Inst,
243 stack_slot: ir::StackSlot,
244 offset: ir::immediates::Offset32,
245) -> WalkCommand {
246 let mut pos = FuncCursor::new(func).at_inst(inst);
247 pos.use_srcloc(inst);
248
249 let ty = pos.func.dfg.value_type(pos.func.dfg.first_result(inst));
250 let addr_ty = isa.pointer_type();
251
252 let addr = pos.ins().stack_addr(addr_ty, stack_slot, offset);
253
254 // Stack slots are required to be accessible.
255 // We can't currently ensure that they are aligned.
256 let mut mflags = MemFlagsData::new();
257 mflags.set_notrap();
258
259 pos.func.replace(inst).load(ty, mflags, addr, 0);
260
261 WalkCommand::Continue
262}

Callers 1

simple_legalizeFunction · 0.85

Calls 10

at_instMethod · 0.80
use_srclocMethod · 0.80
first_resultMethod · 0.80
set_notrapMethod · 0.80
newFunction · 0.50
value_typeMethod · 0.45
pointer_typeMethod · 0.45
insMethod · 0.45
loadMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected