This patch adds a builtin constant that lowers to freeze(poison).
This is necessary to patch the intrinsics like e.g., mm256_castsi128_si256 to be lowered to the following sequence:
%a1 = freeze <2 x double> poison // <- would like to represent this as '__builtin_unspecified_value' in C/C++. %res = shufflevector <2 x double> %a0, <2 x double> %a1, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
Currently it is being lowered to:
%res = shufflevector <2x double> %a0, undef, <4 x i32> <i32 0, i32 1, i32 -1, i32 -1>
The current lowering may incorrectly introduce undefined behavior.
A related, previous patch was here: https://reviews.llvm.org/D130339
I'm not certain we want to expose this via the C APIs. Those APIs are stable APIs and this is exposing an LLVM IR implementation detail (in an area that's traditionally been rather unclear and actively worked on in LLVM IR). I don't know that we're ready to commit to never changing the behavior from LLVM's side.