@@ -299,12 +299,12 @@ macro_rules! isle_prelude_methods {
299299/// internally has a temporary reference to a machinst `LowerCtx`.
300300pub ( crate ) struct IsleContext < ' a , C : LowerCtx , F , I , const N : usize >
301301where
302- [ C :: I ; N ] : smallvec:: Array ,
302+ [ ( C :: I , bool ) ; N ] : smallvec:: Array ,
303303{
304304 pub lower_ctx : & ' a mut C ,
305305 pub flags : & ' a F ,
306306 pub isa_flags : & ' a I ,
307- pub emitted_insts : SmallVec < [ C :: I ; N ] > ,
307+ pub emitted_insts : SmallVec < [ ( C :: I , bool ) ; N ] > ,
308308}
309309
310310/// Shared lowering code amongst all backends for doing ISLE-based lowering.
@@ -323,7 +323,7 @@ pub(crate) fn lower_common<C, F, I, const N: usize>(
323323) -> Result < ( ) , ( ) >
324324where
325325 C : LowerCtx ,
326- [ C :: I ; N ] : smallvec:: Array < Item = C :: I > ,
326+ [ ( C :: I , bool ) ; N ] : smallvec:: Array < Item = ( C :: I , bool ) > ,
327327{
328328 // TODO: reuse the ISLE context across lowerings so we can reuse its
329329 // internal heap allocations.
@@ -367,7 +367,7 @@ where
367367 renamer. add_rename ( * temp, dst. to_reg ( ) , * ty) ;
368368 }
369369 }
370- for inst in isle_ctx. emitted_insts . iter_mut ( ) {
370+ for ( inst, _ ) in isle_ctx. emitted_insts . iter_mut ( ) {
371371 map_regs ( inst, & renamer) ;
372372 }
373373
@@ -387,8 +387,12 @@ where
387387 // Once everything is remapped we forward all emitted instructions to the
388388 // `lower_ctx`. Note that this happens after the synthetic mov's above in
389389 // case any of these instruction use those movs.
390- for inst in isle_ctx. emitted_insts {
391- lower_ctx. emit ( inst) ;
390+ for ( inst, is_safepoint) in isle_ctx. emitted_insts {
391+ if is_safepoint {
392+ lower_ctx. emit_safepoint ( inst) ;
393+ } else {
394+ lower_ctx. emit ( inst) ;
395+ }
392396 }
393397
394398 Ok ( ( ) )
0 commit comments