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

[GlobalISel] Fix G_PTR_ADD immediate chain combine using the wrong im… #65271

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

aemerson
Copy link
Contributor

@aemerson aemerson commented Sep 4, 2023

…mediate for heuristics.

The legal-addressing-mode heuristics in the combine checks that for a pattern:

%ptr1 = G_PTR_ADD %_, C_outer
%ptr2 = G_PTR_ADD %ptr1, C_inner

...whether a base_reg + C_outer addressing mode is legal as the original address. However, the original pointer being analyzed is %ptr2, so it should be C_inner.

This provides a 0.1% geomean improvement on CTMark -Os for AArch64.

…mediate for heuristics.

The legal-addressing-mode heuristics in the combine checks that for a pattern:
%ptr1 = G_PTR_ADD %_, C_outer
%ptr2 = G_PTR_ADD %ptr1, C_inner

...whether a base_reg + C_outer addressing mode is legal as the *original* address.
However, the original pointer being analyzed is %ptr2, so it should be C_inner.

This provides a 0.1% geomean improvement on CTMark -Os for AArch64.
@aemerson aemerson requested review from a team as code owners September 4, 2023 15:40
@aemerson aemerson merged commit 91746d1 into llvm:main Sep 5, 2023
1 check passed
@aemerson aemerson deleted the ptradd-imm branch September 5, 2023 00:06
avillega pushed a commit to avillega/llvm-project that referenced this pull request Sep 11, 2023
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.

None yet

2 participants