[InstCombine] Convert mem intrinsic with null into a noop (#100388)
When src/dest passed into memset/memcpy is null:
```
len == 0: this call is a noop.
len != 0: the behavior is undefined.
```
[InstCombine] Convert mem intrinsic with null into a noop (#100388)
When src/dest passed into memset/memcpy is null:
```
len == 0: this call is a noop.
len != 0: the behavior is undefined.
```
See also https://llvm.org/docs/LangRef.html#llvm-memset-intrinsics
Alive2: https://alive2.llvm.org/ce/z/tJeRNL
This patch converts these mem intrinsic calls into an assumption `len ==
0` to mitigate code-size bloat caused by JumpThreading.
show more ...
|