[LangRef] Global variable declarations imply minimum size
authorNikita Popov <npopov@redhat.com>
Wed, 1 Feb 2023 10:18:47 +0000 (11:18 +0100)
committerNikita Popov <npopov@redhat.com>
Tue, 14 Feb 2023 07:23:37 +0000 (08:23 +0100)
commit2e9549db268645accb83ebf031fbb1de84b00ca9
tree90329fe3747e20ee2439ca92c66bde719ff61cca
parentaf838c1b1c20c7b3b970e81039a1992857fe76bb
[LangRef] Global variable declarations imply minimum size

Adjust the wording added in D78952 to say that global variable
declarations (and interposable definitions) do imply a minimum
size (and alignment) on the global. They just don't imply a
maximum size.

We rely on these semantics in at least two places:

* Global dereferenceability: https://github.com/llvm/llvm-project/blob/2153544865a9733b06579823814c981f735e4201/llvm/lib/IR/Value.cpp#L907
* Global inbounds GEP: https://github.com/llvm/llvm-project/blob/2153544865a9733b06579823814c981f735e4201/llvm/lib/IR/ConstantFold.cpp#L2283

Differential Revision: https://reviews.llvm.org/D143057
llvm/docs/LangRef.rst