-
Notifications
You must be signed in to change notification settings - Fork 1.8k
AArch64 Zero/SignExtend elision is inadequate #239
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
|
n.b. bumped JDK9 version in Travis YAML so build can proceed |
|
Our internal gate checks that there are no Eclipse warnings. Is it possible for you to check this as well? We can't do it in Travis until openjdk8 binaries are available. |
cff345b to
566fa64
Compare
|
Hmm, I'm not sure what is happening here but I think that comments relates to a different PR. |
|
Ah, ok, I think I understand what has happened. That file was in my last PR but is not yet in my tree. The fix for PR #237 must now be in upstream (it wasn't when I created the PR). I will need to pull frm upstream and rebase this PR. Just a second ... |
|
Hmm, no I don't seem to have StackStoreLoadTest in my tree -- did you mean to post this to the other PR? |
566fa64 to
2283516
Compare
|
I'm seeing an error from Travis here that I don't really understand. When I run mx canonicalizeprojects on my tree I see no errors. Any ideas? |
|
Ah ok, my mistake: I now get this error Can anyone tell me what it means? n.b. my fix changed suite.py to allow my LowTier Node class AArch64ReadNode to see classes in org.graalvm.compiler.core.aarch64. No doubt that is the source of this problem. Is there some other way round this. |
|
There's a canonical form for the contents of the dependencies so that we don't duplicate dependencies. When you change one you might then need to adjust others. So just make dependencies section of the projects it's complaining about look like it says. |
|
Ok, I fixed the dependencies and the Travis build has now passed |
|
I'll put this through. As an aside we've talked several times about doing exactly this but in a more general way. The FixReadsPhase actually provides a good time to do this now. We just need to have two stamps in a ReadNode, one for the size of the memory operation and one for the resulting type. There's already an API split for this stamp vs getAccessStamp we just need to propagate the split through the backends. |
|
Thanks for accepting this as is. I agree that a generic solution to this would be better in the long run. It should be straightforward to remove the AArch64-specific phase & read node when working a generic fix through to the back ends. |
6a70143 to
270d55f
Compare
| } | ||
| if (node instanceof ReadNode) { | ||
| ReadNode readNode = (ReadNode) node; | ||
| if (readNode.getUsageCount() == 1) { |
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.
Note that there is Node#hasExactlyOneUsage to cover this idiom without having to actually do the counting.
This patch fixes the problem reported here: #238
When running on AArch64 it adds a phase to the LowTier just before the Scheduling phase. This new phase replaces pairs of Read + Sign/ZeroExtend nodes with an AArch64ReadNode that combines the read and extend operation into one.
The patch includes a unit test (ZeroSignExtendTest) which exercises the node replacement for the newly added phase. Generated code for the test snippets before and after the patch shows that the patched version elides redundant stxw or andw instructions that the previous match rules could not eliminate.
Atached assembler dumps for the before and after code show the improvement.
extend-before.txt
extend-after.txt