Skip to content

[RFC][RISCV] Set enableSpillageCopyElimination #132035

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

asb
Copy link
Contributor

@asb asb commented Mar 19, 2025

This is an additional optimisation in MachineCopyPropagation that is currently only enabled for PPC. After spotting it looking at something else with MCP and trying it out, I see it does indeed clear at least some instances of register value shuffling in llvm-test-suite. The test case I pulled out isn't necessarily the best one, and may or may not make more sense as .mir - I just grabbed something to demonstrate the impact for discussion.

Posting as RFC in case anyone else has looked at this. We would want to check any compile time impact is manageable. It's worth noting the optimisation relies on checking TII.isCopyInstr quite a lot, so it's not impossible there is further impact from fleshing out isCopyInstrImpl as started in #132002.

@preames
Copy link
Collaborator

preames commented Mar 19, 2025

Glancing at the code, I see no obvious reason we can't turn this on. As noted, we'd need to check compile time, and perf impact, but I don't see any blockers beyond that.

It's a slightly weird pattern to see in code, but if we're seeing it, and you seem to be saying we are, why not?

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

Successfully merging this pull request may close these issues.

2 participants