[all-commits] [llvm/llvm-project] 96af11: [InstCombine] Preserve the nsw/nuw flags for (X | ...

csstormq via All-commits all-commits at lists.llvm.org
Fri Jun 7 17:38:49 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 96af11494158c38dafb64ffeaec3f371f37f0eb4
      https://github.com/llvm/llvm-project/commit/96af11494158c38dafb64ffeaec3f371f37f0eb4
  Author: csstormq <swust_xiaoqiangxu at 163.com>
  Date:   2024-06-08 (Sat, 08 Jun 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
    M llvm/test/Transforms/InstCombine/add.ll
    M llvm/test/Transforms/InstCombine/sadd-with-overflow.ll
    M llvm/test/Transforms/PhaseOrdering/AArch64/matrix-extract-insert.ll

  Log Message:
  -----------
  [InstCombine] Preserve the nsw/nuw flags for (X | Op01C) + Op1C --> X + (Op01C + Op1C) (#94586)

This patch simplifies `sdiv` to `udiv` by preserving the `nsw` flag for
`(X | Op01C) + Op1C --> X + (Op01C + Op1C)` if the sum of `Op01C` and
`Op1C` will not overflow, and preserves the `nuw` flag unconditionally.

Alive2 Proofs (provided by @nikic): https://alive2.llvm.org/ce/z/nrdCZT,
https://alive2.llvm.org/ce/z/YnJHnH



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