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

[RuntimeDyldChecker][AArch32] Add a PC offset to next_PC for ARM targets #91746

Merged
merged 6 commits into from
May 28, 2024

Conversation

eymay
Copy link
Contributor

@eymay eymay commented May 10, 2024

In ARM mode, the Program Counter (PC) points to the current instruction's
address + 8 instead of + 4. This offset is added to RuntimeDyldChecker to
use next_pc expression in JITLink tests.

Copy link
Contributor

@weliveindetail weliveindetail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Thanks for your proposal. I think it's valuable. Your second patch seemed very much to the point. Maybe with a more verbose comment like:

# ARM branch offset is 8, because it accounts for an additional prefetch
# instruction that increments PC even though it is implicit
We could then clean up these comments in the tests. What do you think?

"expected '+' for offset or ')' if no offset"),
"");
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only used in a single test, right? If we really want to use it there, we should rather fix the test by adding another label. Otherwise, if we really want to go down this road, it would probably be best to support full expressions here again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a little doubtful with adding the feature for a single case and I think you are right, this solves a problem we might not need to have. I will update the test instead.

@eymay
Copy link
Contributor Author

eymay commented May 24, 2024

Hey! Thanks for your proposal. I think it's valuable. Your second patch seemed very much to the point. Maybe with a more verbose comment like:

# ARM branch offset is 8, because it accounts for an additional prefetch
# instruction that increments PC even though it is implicit

We could then clean up these comments in the tests. What do you think?

Thanks for the review! Sounds good, I was conservative with line estate as the checker deals with all targets but more explanation would not hurt definitely.

Copy link
Contributor

@weliveindetail weliveindetail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, this LGTM!

Seems like all our tests passed and the pre-merge check just failed due to some build problem in MLIRSupport library. Would be nice to have a green light here anyway. Maybe you can try and force push again? Thx

@weliveindetail
Copy link
Contributor

Flang failed to build on Windows with "compiler is out of heap space" -- once again an issue with the infra. Since all our tests passed, I think this is ready to land. Thanks again for working on this!

@eymay
Copy link
Contributor Author

eymay commented May 28, 2024

Flang failed to build on Windows with "compiler is out of heap space" -- once again an issue with the infra. Since all our tests passed, I think this is ready to land. Thanks again for working on this!

Thanks for the green light!

@eymay eymay merged commit f29352b into llvm:main May 28, 2024
5 of 7 checks passed
vg0204 pushed a commit to vg0204/llvm-project that referenced this pull request May 29, 2024
…ets (llvm#91746)

In ARM mode, the Program Counter (PC) points to the current instruction's
address + 8 instead of + 4. An offset is added to RuntimeDyldChecker to
use `next_pc` expression in JITLink tests with both Thumb and Arm.
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