File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -315,13 +315,14 @@ 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
- while let Some ( & inst) = stack_slot_users. stack_addr . iter ( ) . next ( ) {
318
+ // FIXME: Remove clone
319
+ for & inst in stack_slot_users. stack_addr . clone ( ) . iter ( ) {
319
320
if stack_addr_load_insts_users. get ( & inst) . map ( |users| users. is_empty ( ) ) . unwrap_or ( true ) {
320
321
stack_slot_users. remove_unused_stack_addr ( & mut opt_ctx. ctx . func , inst) ;
321
322
}
322
323
}
323
324
324
- while let Some ( & inst) = stack_slot_users. stack_load . iter ( ) . next ( ) {
325
+ for & inst in stack_slot_users. stack_load . clone ( ) . iter ( ) {
325
326
if stack_addr_load_insts_users. get ( & inst) . map ( |users| users. is_empty ( ) ) . unwrap_or ( true ) {
326
327
stack_slot_users. remove_unused_load ( & mut opt_ctx. ctx . func , inst) ;
327
328
}
You can’t perform that action at this time.
0 commit comments