1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Go to file
John McCall 93f2c3b449 Add an algorithm for performing "optimal" layout of a struct.
The algorithm supports both assigning a fixed offset to a field prior to
layout and allowing fields to have sizes that aren't multiples of their
required alignments.  This means that the well-known algorithm of sorting
by decreasing alignment isn't always good enough.  Still, we start with
that, and only if that leaves padding around do we fall back on a greedy
padding-minimizing algorithm.

There is no known efficient algorithm for producing a guaranteed-minimal
layout in all cases.  In fact, allowing arbitrary fixed-offset fields means
there's a straightforward reduction from bin-packing, making this NP-hard.
But as usual with such problems, we can still efficiently produce adequate
solutions to the cases that matter most to us.

I intend to use this in coroutine frame layout, where the retcon lowerings
very badly want to minimize total space usage, and where the switch lowering
can indeed produce a header with interior padding if the promise field is
highly-aligned.  But it may be useful in a much wider variety of situations.
2020-03-23 23:24:48 -04:00
benchmarks
bindings Add an SDK attribute to DICompileUnit 2020-03-11 14:14:06 -07:00
cmake Don't export symbols from clang/opt/llc if plugins are disabled. 2020-03-23 12:17:09 -07:00
docs [GlobalISel] Add generic opcodes for saturating add/subtract 2020-03-23 15:16:45 +00:00
examples [examples] Fixes for BUILD_SHARED_LIBS=on 2020-03-23 15:21:45 -07:00
include Add an algorithm for performing "optimal" layout of a struct. 2020-03-23 23:24:48 -04:00
lib Add an algorithm for performing "optimal" layout of a struct. 2020-03-23 23:24:48 -04:00
projects Add few docs and implementation of strcpy and strcat. 2019-10-04 17:30:54 +00:00
resources In MSVC builds embed a VERSIONINFO resource in our exe and DLL files. 2015-06-12 15:58:29 +00:00
runtimes [runtimes] When COMPILER_RT is enabled, consider SANITIZER prefixes 2020-03-11 14:22:20 -07:00
test [GlobalISel] Combine G_SELECTs of the form (cond ? x : x) into x 2020-03-23 16:46:03 -07:00
tools [llvm-objcopy] Improve tool selection logic to recognize llvm-strip-$major as strip 2020-03-23 13:49:26 -07:00
unittests Add an algorithm for performing "optimal" layout of a struct. 2020-03-23 23:24:48 -04:00
utils scudo: Create a public include directory. NFCI. 2020-03-23 18:23:29 -07:00
.clang-format
.clang-tidy - Update .clang-tidy to ignore parameters of main like functions for naming violations in clang and llvm directory 2020-01-31 16:49:45 +00:00
.gitattributes Fix the "git modified" issue on the preserve-comments-crlf.s. 2019-09-10 12:17:49 +00:00
.gitignore Continue removing llgo. 2020-02-10 10:33:58 -08:00
CMakeLists.txt [cmake] Fix -stripped for umbrella library install targets 2020-03-20 18:46:48 -07:00
CODE_OWNERS.TXT Remove myself from CODE_OWNERS. 2020-02-25 11:59:29 +00:00
configure
CREDITS.TXT Update email address. 2019-07-17 07:02:02 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
llvm.spec.in Update structured references to the license to the new license. 2019-01-19 11:30:51 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
README.txt Test commit. 2020-03-14 18:08:26 -07:00
RELEASE_TESTERS.TXT Update the list of platforms & archs 2018-12-16 14:47:16 +00:00

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.