llvm-project/llvm/test/Transforms/InferFunctionAttrs
Juneyoung Lee 481c62277d [BuildLibCalls] Add noundef to allocator fns' size
This is a patch to explicitly mark the size parameter of allocator functions like malloc/realloc/... as noundef.

For C/C++: undef can be created from reading an uninitialized variable or padding.
Calling a function with uninitialized variable is already UB.
Calling malloc with padding value is.. something that's not expected. Padding bits may appear in a coerced aggregate, which doesn't apply to malloc's size.
Therefore, malloc's size can be marked as noundef.

For transformations that introduce malloc/realloc/..: I ran LLVM unit tests with an updated Alive2 semantics, and found no regression, so it seems okay.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D97045
2021-02-23 13:58:03 +09:00
..
annotate.ll [BuildLibCalls] Add noundef to allocator fns' size 2021-02-23 13:58:03 +09:00
dereferenceable-inseltpoison.ll Precommit transform tests that have poison as insertelement's placeholder 2020-12-24 11:46:17 +09:00
dereferenceable.ll [Attributor] Copy or port test cases related to Attributor to` Attributor` test folder 2019-12-02 15:36:29 +00:00
no-proto.ll
norecurse_debug.ll [FunctionAttrs] Infer willreturn for functions without loops 2021-01-21 20:29:33 +01:00
pr30455.ll