[llvm] [InstCombine] Avoid Allocating Arrays Too Large For the Target (PR #70980)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 08:31:04 PDT 2023


nikic wrote:

It's generally understood that an allocation larger than half the address space is undefined behavior -- using a negative alloca size would result in such an allocation.

LangRef isn't super explicit on this though, it only has this note in the GEP specification:

> These rules are based on the assumption that no allocated object may cross the unsigned address space boundary, and no allocated object may be larger than half the pointer index type space.

https://github.com/llvm/llvm-project/pull/70980


More information about the llvm-commits mailing list