[all-commits] [llvm/llvm-project] 4e89d1: [InstCombine] Convert mem intrinsic with null into...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Thu Aug 1 07:46:29 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e89d1199c180fd384486ba2796368ec800180ee
      https://github.com/llvm/llvm-project/commit/4e89d1199c180fd384486ba2796368ec800180ee
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2024-08-01 (Thu, 01 Aug 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    A llvm/test/Transforms/InstCombine/mem-intrinsics.ll
    M llvm/test/Transforms/InstCombine/mempcpy.ll

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list