History log of /llvm-project/llvm/test/Transforms/InstCombine/mem-intrinsics.ll (Results 1 – 1 of 1)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2
# 4e89d119 01-Aug-2024 Yingwei Zheng <dtcxzyw2333@gmail.com>

[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 ...