File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -315,14 +315,13 @@ fn remove_unused_stack_addr_and_stack_load(opt_ctx: &mut OptimizeContext<'_>) {
315
315
316
316
// Replace all unused stack_addr and stack_load instructions with nop.
317
317
for stack_slot_users in opt_ctx. stack_slot_usage_map . values_mut ( ) {
318
- // FIXME remove clone
319
- for & inst in stack_slot_users. stack_addr . clone ( ) . iter ( ) {
318
+ while let Some ( & inst) = stack_slot_users. stack_addr . iter ( ) . next ( ) {
320
319
if stack_addr_load_insts_users. get ( & inst) . map ( |users| users. is_empty ( ) ) . unwrap_or ( true ) {
321
320
stack_slot_users. remove_unused_stack_addr ( & mut opt_ctx. ctx . func , inst) ;
322
321
}
323
322
}
324
323
325
- for & inst in stack_slot_users. stack_load . clone ( ) . iter ( ) {
324
+ while let Some ( & inst) = stack_slot_users. stack_load . iter ( ) . next ( ) {
326
325
if stack_addr_load_insts_users. get ( & inst) . map ( |users| users. is_empty ( ) ) . unwrap_or ( true ) {
327
326
stack_slot_users. remove_unused_load ( & mut opt_ctx. ctx . func , inst) ;
328
327
}
You can’t perform that action at this time.
0 commit comments