llvm-project/clang/test/CXX
Roman Lebedev 564d85e090
The maximal representable alignment in LLVM IR is 1GiB, not 512MiB
In LLVM IR, `AlignmentBitfieldElementT` is 5-bit wide
But that means that the maximal alignment exponent is `(1<<5)-2`,
which is `30`, not `29`. And indeed, alignment of `1073741824`
roundtrips IR serialization-deserialization.

While this doesn't seem all that important, this doubles
the maximal supported alignment from 512MiB to 1GiB,
and there's actually one noticeable use-case for that;
On X86, the huge pages can have sizes of 2MiB and 1GiB (!).

So while this doesn't add support for truly huge alignments,
which i think we can easily-ish do if wanted, i think this adds
zero-cost support for a not-trivially-dismissable case.

I don't believe we need any upgrade infrastructure,
and since we don't explicitly record the IR version,
we don't need to bump one either.

As @craig.topper speculates in D108661#2963519,
this might be an artificial limit imposed by the original implementation
of the `getAlignment()` functions.

Differential Revision: https://reviews.llvm.org/D108661
2021-08-26 12:53:39 +03:00
..
basic Implement P1937 consteval in unevaluated contexts 2021-08-06 10:29:28 -04:00
class [clang] C++98 implicit moves are back with a vengeance 2021-07-13 19:16:49 +02:00
class.access [clang] Implement P0692R1 from C++20 (access checking on specializations and instantiations) 2021-08-10 19:20:50 +04:00
class.derived Defer checking for mismatches between the deletedness of and overriding 2020-03-12 13:07:22 -07:00
conv [Sema][C++] Propagate conversion kind to specialize the diagnostics 2020-02-25 16:05:37 +00:00
cpp [Clang] Add __STDCPP_THREADS__ to standard predefine macros 2020-11-22 16:05:53 -08:00
dcl [clang] Fix ICE on invalid type parameters for concepts 2021-03-13 01:23:02 +01:00
dcl.dcl [Clang][DiagnosticSemaKinds] combine diagnostic texts 2021-08-06 13:58:21 -07:00
dcl.decl Remove unnecessary triple from test 2021-06-15 09:49:45 -07:00
drs The maximal representable alignment in LLVM IR is 1GiB, not 512MiB 2021-08-26 12:53:39 +03:00
except Disallow narrowing conversions to bool in noexcept specififers 2021-08-06 10:26:39 -04:00
expr [clang] fix crash on template instantiation of invalid requires expressions 2021-08-03 23:16:04 +02:00
lex Add type information to integral template argument if required. 2021-05-12 19:00:08 +00:00
module Improve diagnostics for missing import / #include of module. 2020-04-28 18:41:14 -07:00
modules-ts Fix a diagnoses-valid bug with using declarations 2021-06-04 15:52:07 -04:00
over [c++20] Further extend the set of comparisons broken by C++20 that we 2020-03-20 14:22:48 -07:00
special [clang] tests: cleanup, update and add some new ones 2021-04-09 17:24:08 +02:00
stmt.stmt Partially implement P1401R5 (Narrowing contextual conversions to bool) 2021-07-12 08:06:27 -04:00
temp [clang] Implement P0692R1 from C++20 (access checking on specializations and instantiations) 2021-08-10 19:20:50 +04:00