This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Decrease alignment of ThunkSection on 64-bit targets from 8 to 4
ClosedPublic

Authored by MaskRay on Jan 15 2020, 6:01 PM.

Details

Summary

ThunkSection contains 4-byte instructions on all targets that use
thunks. Thunks should not be used in any performance sensitive places,
and locality/cache line/instruction fetching arguments should not apply.

We use 16 bytes as preferred function alignments for modern PowerPC cores.
In any case, 8 is not optimal.

Diff Detail

Unit TestsFailed

Event Timeline

MaskRay created this revision.Jan 15 2020, 6:01 PM

Unit tests: fail. 61901 tests passed, 7 failed and 782 were skipped.

failed: lld.ELF/aarch64-cortex-a53-843419-thunk.s
failed: lld.ELF/aarch64-thunk-pi.s
failed: lld.ELF/aarch64-thunk-script.s
failed: lld.ELF/ppc64-dtprel.s
failed: lld.ELF/ppc64-ifunc.s
failed: lld.ELF/ppc64-tls-gd.s
failed: lld.ELF/ppc64-toc-restore.s

clang-tidy: unknown.

clang-format: pass.

Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

I'm happy to go ahead with this. The maximum alignment for instructions on Arm and AArch64 is 4, which is what the compiler uses for code sections.

MaskRay updated this revision to Diff 238542.Jan 16 2020, 10:35 AM
MaskRay edited the summary of this revision. (Show Details)

Fix tests

This revision was not accepted when it landed; it landed in state Needs Review.Jan 16 2020, 10:41 AM
This revision was automatically updated to reflect the committed changes.

Unit tests: fail. 61922 tests passed, 1 failed and 783 were skipped.

failed: lld.ELF/conflict.s

clang-tidy: unknown.

clang-format: pass.

Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml