For normal stack slots this would just be some extra code in cg_clif. For register spill stack slots it would require a Cranelift pass to run after regalloc has created register spill slots. For registers there may need to be a new instruction to zero a specific register, or the Cranelift pass can add iconst
/fconst
/vconst
instructions with specific registers for their SSA values after DCE has run. I also assume that the flags register will need to be cleared (new instruction) All together it should not be too hard to add this to Cranelift.
1 Like