OVERVIEW:
This is the first in a sequence of exploratory patches using poison semantics
for uninitialized memory.
METADATA:
The new metadata, freeze_bits, is used to convert poison to a nondeterministic
value. Application of freeze_bits is limited load type instructions only.
See the following URL for the RFC discussion:
https://discourse.llvm.org/t/rfc-load-instruction-uninitialized-memory-semantics/67481
BITCODE:
To facilitate in place migration of bitcode. A new versions of load and load
atomic are added; numeric identifiers 21 and 53. Auto migration is performed to
older loads by automatically applying freeze_bits metadata.
IR:
For convenience, an isFreezing parameter is add IRBuilder load functions. This
appends the attribute !freeze_bits to a load instruction. All IRBuilder
CreateLoad and CreateAlignedLoad function definitions default isFreezing to
true. This will allow front ends to transition to the new load instruction
semantics in a piecemeal fashion.
C-API:
Load instruction version 1 semantics are supported using the legacy function
LLVMBuildLoad2, which will add attribute !freeze_bits for compatibility. Load
instruction version 2 semantics are supported using function
LLVMBuildLoad3. This commit marks LLVMBuildLoad2 for future deprecation.