-
Notifications
You must be signed in to change notification settings - Fork 31
Fix SSABraun bug and add SSA tests #542
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
Conversation
👋 Welcome back rbrchen! A progress list of the required criteria for merging this PR into |
@rbrchen This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@PaulSandoz) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Webrevs
|
Hi, it's not obvious to me what the bug is. The |
Hi! Sorry about the confusion; I just realized this change doesn't actually fix the bug, and that the core of the problem lies in how the maps Your original code in I can restore your code and implement those changes to make sure that the two maps replace deleted phis with appropriate values. |
Interesting, thanks for the investigation! A few pointers regarding the mentioned maps:
These are the parts not present in the original algorithm due to (im)mutability, so I always suspected these to be the most fragile parts of the implementation. If you have any ideas to simplify these "workarounds", I'd be very happy :) |
Thanks for the pointers! I'll circle back to this PR with any ideas and/or code changes for the maps :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I looked into this a bit closer now with your latest change, and I think it makes sense this way. Interestingly, the original implementation works slightly different than what's described in the paper https://github.com/libfirm/libfirm/blob/114012d1d93427e63ba2f2ab51318e8a1b92f06c/ir/ir/ircons.c#L6.
I wonder if this is an oversight in the algorithm described in the paper.
src/jdk.incubator.code/share/classes/jdk/incubator/code/analysis/SSABraun.java
Outdated
Show resolved
Hide resolved
Thanks for looking it over! Yeah, I think it might've been an oversight in the paper's algorithm. Looking at the actual implementation right now, I see how they arrived at the paper's pseudocode, but it's interesting that the paper went ahead with those slight differences :') |
/integrate |
/integrate |
@rbrchen Only Committers are allowed to sponsor changes. |
/integrate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done. We can investigate and address the use of identity equality in another PR, if necessary.
/sponsor |
Going to push as commit ab94fe7. |
@PaulSandoz @rbrchen Pushed as commit ab94fe7. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Fix a bug in SSABraun where, in
tryRemoveTrivialPhi()
, a phi stored insame
that is later deleted in a recursivetryRemoveTrivialPhi()
call is still returned despite being deleted.Add five tests to TestSSA:
deadCode(), ifelseLoopNested(), violaJones(), binarySearch(),
andquicksort()
.violaJones()
is inspired by the methodfindFeaturesKernel
in HAT kernel ViolaJones, which is the bug first presented itself.Progress
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/babylon.git pull/542/head:pull/542
$ git checkout pull/542
Update a local copy of the PR:
$ git checkout pull/542
$ git pull https://git.openjdk.org/babylon.git pull/542/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 542
View PR using the GUI difftool:
$ git pr show -t 542
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/babylon/pull/542.diff
Using Webrev
Link to Webrev Comment