By aligning small variables to word alignment, I noticed modest overall improvements between 1 and 2% with just a few modest regressions.
Details
- Reviewers
t.p.northover - Commits
- rG230083ff9dc0: [AArch64] Change the preferred alignment for char and short to word alignment
rG04abc14fb5e9: [AArch64] Change the preferred alignment for char and short to word alignment
rC273280: [AArch64] Change the preferred alignment for char and short to word alignment
rL273280: [AArch64] Change the preferred alignment for char and short to word alignment
rL273279: [AArch64] Change the preferred alignment for char and short to word alignment
Diff Detail
- Repository
- rL LLVM
Event Timeline
And what CPU did you run the tests on? As far as I know the larger cores don't care about alignment as long as a cache line isn't crossed (which it won't be for the natural alignment).
What about code size?
I observed an insignificant (<0.01%) increase in the code size.
That's the problem that I noticed, especially with some variables being aggressively accessed in wider chunks (often by library code) crossing cache lines.
Though I'd expect that 64-bit alignment would be the preferred alignment in AArch64, any difference from 32-bit alignment was overall too small to notice.
I tested these changes only on Cortex A57 and Exynos M1 and both benefit from this preferred alignment (depending on the benchmark, A57 more so than M1).
Hi Evandro,
Who approved this patch?
Also, we're seeing a ~1.8% regression in SPEC2006/perlbench on Kryo. Runs for the other SPEC2006 benchmarks are in flight. What workloads did you use for testing?
Chad
I haven't approved yet, nor I've seen Tim do it. I think we better revert it for now until further clarifications come to light.
cheers,
--renato
Folks,
I took it that Tim approved this patch when he said in an email: "I'm happy for you to go ahead."
Sorry Evandro, I forgot about that email, now I remembered.
Still, this was a contentious issue, and it did have some bad reactions. I think we need more testing and benchmarking.
At least now we have more data to discuss it on.
cheers,
--renato
I tested on both M1 and A57 using SPEC CPU2000 and proprietary benchmarks. I noticed minor regressions and significant improvements on both targets
I've reverted the commits in r274766-r274768. Sorry about that, Evandro. I didn't know Tim approved via email. We should have Kryo numbers shortly, if you can wait.
You don't just revert a two weeks old patch BEFORE tests for one target are in and BEFORE comparing its results with other targets.
The burden of proof now lied with you to revert the patch, but your reverting it put the burden back on me.
Make no mistake, I do not appreciate that.
My apologies Evandro. I know we have a policy that approved patches on the list are also valid, and that this review not being in the "approve" status doesn't count. I should have searched the list for more information.
Chad, maybe re-instate the patch and discuss this on the list would be the best way forward now.
cheers,
--renato
Please understand the reason I reverted the patch was because I didn't see formal approval. That alone is justification enough.
I apologize I missed Tim's email; I did search the list for an informal LGTM, but I found nothing.
Make no mistake, I do not appreciate that.
Understandable.. Evandro, please make the assumption that everyone is trying to do the right thing. I've seen patches committed without proper approval on too many occasion; I sincerely apologize if you we're caught in the crossfire.
The final results for Spec2006 on Kryo were a net gain of 0.2% geomean, so thank you. That being said, I'll go ahead a recommit the patches.
Chad
Indeed, too many assumptions were made here. However, we can certainly agree that not waiting even 15min for a reply of the author of the patch, myself, was precipitated. Hopefully, in the future, we'll be able to avoid such actions on anecdotal information.
I'm glad to learn that the results show benefits on Kryo too.
Thanks for reinstating the patches.
I think some of the confusion here may have been due to the fact that llvm-commits wasn't added as a subscriber to the review. Since it wasn't on the list, few people were probably aware of the patch or its approval. Glad everything is resolved now!