[all-commits] [llvm/llvm-project] 2e9549: [LangRef] Global variable declarations imply minim...

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Feb 13 23:23:53 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2e9549db268645accb83ebf031fbb1de84b00ca9
      https://github.com/llvm/llvm-project/commit/2e9549db268645accb83ebf031fbb1de84b00ca9
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    M llvm/docs/LangRef.rst

  Log Message:
  -----------
  [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




More information about the All-commits mailing list