Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unneeded reloads #631

Open
vladimirradosavljevic opened this issue Jun 21, 2024 · 0 comments
Open

Remove unneeded reloads #631

vladimirradosavljevic opened this issue Jun 21, 2024 · 0 comments

Comments

@vladimirradosavljevic
Copy link
Contributor

vladimirradosavljevic commented Jun 21, 2024

After #494, we can get the following pattern (taken from the M3B3 tests/yul/semantic/for.yul) generated in the regalloc:

	add	r1, r0, stack-[3]               ; 32-byte Folded Spill
	add	stack-[3], r0, r1               ; 32-byte Folded Reload

In this case, reload is not needed since the previous instruction spills the same register to the same stack slot as in the reload.
Since there is an optimization to remove unneeded spills if the previous instruction is reload from the same stack slot (StackSlotColoring::RemoveDeadStores), create a similar optimization to remove unneeded reloads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant