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

support alignment ops when processing statements in RegisterUse #406

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

Ptival
Copy link
Contributor

@Ptival Ptival commented Jul 23, 2024

For some reason we were very conservative in our support or abstract
operations over the processor state in the RegisterUse analysis.

In particular, we were failing to process code such as:

r23 := (bv_and r21 (0xfffffffffffffff0 :: [64]))

whose goal is to align the value in r21 at a 16-byte boundary.

This resulted in us failing to analyze some code that was realigning its
stack pointer. With this change, the same code succeeds at propagating
the abstract stack pointer offset forward.

@Ptival Ptival marked this pull request as draft July 23, 2024 23:24
@Ptival Ptival force-pushed the vr/register-use-bvand branch from dc21c4c to 0986922 Compare July 24, 2024 15:43
@Ptival Ptival marked this pull request as ready for review July 24, 2024 15:47
@Ptival Ptival requested a review from RyanGlScott July 24, 2024 15:47
Copy link
Contributor

@RyanGlScott RyanGlScott left a comment

Choose a reason for hiding this comment

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

This is definitely an improvement.

base/src/Data/Macaw/Analysis/RegisterUse.hs Outdated Show resolved Hide resolved
base/src/Data/Macaw/Analysis/RegisterUse.hs Show resolved Hide resolved
For some reason we were very conservative in our support or abstract
operations over the processor state in the `RegisterUse` analysis.

In particular, we were failing to process code such as:

r23 := (bv_and r21 (0xfffffffffffffff0 :: [64]))

whose goal is to align the value in r21 at a 16-byte boundary.

This resulted in us failing to analyze some code that was realigning its
stack pointer.  With this change, the same code succeeds at propagating
the abstract stack pointer offset forward.
@Ptival Ptival force-pushed the vr/register-use-bvand branch from 0986922 to dc1591d Compare July 24, 2024 16:59
@Ptival
Copy link
Contributor Author

Ptival commented Jul 24, 2024

@RyanGlScott I have addressed your comments, and also added two comments that I fell will help me if I ever need to look at this code again.

@Ptival Ptival merged commit eb0a3c7 into master Jul 25, 2024
3 checks passed
@Ptival Ptival deleted the vr/register-use-bvand branch July 25, 2024 19:14
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