[clang] [llvm] [EarlyCSE] Add support for writeonly call CSE (PR #145474)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 27 02:13:20 PDT 2025


https://github.com/dtcxzyw commented:

This patch eliminates many math libcalls that set `errno`. However, it causes some regressions when processing `llvm.memset`.
See the following pattern:
```
memset(p)
if (Cond) {
  memset(p);
  mem access with p
}
```
After this patch, the second memset is removed. However, `MemCpyOptPass` does better since it only removes the first one.

As `MemCpyOpt` handles memory intrinsics more precisely, can we bail out on memset here?



https://github.com/llvm/llvm-project/pull/145474


More information about the llvm-commits mailing list