Use poison instead of undef
In cases where it is legal, we should prefer poison values over undef values. This replaces undef with poison for aggregate construction and for uninhabited types. There are more places where we can likely use poison, but I wanted to stay conservative to start with. In particular the aggregate case is important for newer LLVM versions, which are not able to handle an undef base value during early optimization due to poison-propagation concerns.
This commit is contained in:
parent
cd6c574af3
commit
30331828cb
9 changed files with 17 additions and 6 deletions
|
@ -1069,6 +1069,7 @@ extern "C" {
|
|||
// Operations on constants of any type
|
||||
pub fn LLVMConstNull(Ty: &Type) -> &Value;
|
||||
pub fn LLVMGetUndef(Ty: &Type) -> &Value;
|
||||
pub fn LLVMGetPoison(Ty: &Type) -> &Value;
|
||||
|
||||
// Operations on metadata
|
||||
pub fn LLVMMDStringInContext(C: &Context, Str: *const c_char, SLen: c_uint) -> &Value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue