[all-commits] [llvm/llvm-project] 2472cd: [InstCombine] Refine nuw propagation in `OptimizeP...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Fri Jul 4 08:34:55 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2472cdcb69d2fe0ff3573403be1bd49eb2d62dd8
      https://github.com/llvm/llvm-project/commit/2472cdcb69d2fe0ff3573403be1bd49eb2d62dd8
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2025-07-04 (Fri, 04 Jul 2025)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
    M llvm/test/Transforms/InstCombine/sub-gep.ll

  Log Message:
  -----------
  [InstCombine] Refine nuw propagation in `OptimizePointerDifference` (#147059)

After https://github.com/llvm/llvm-project/pull/146100, the offset may
be generated by a previous call to `EmitGEPOffsets`, causing the nuw
flag on shl to be lost. This patch handles the `shl+ptradd` case as
well. It also fixes a miscompilation in the case of `mul + ptradd`.
Alive2: https://alive2.llvm.org/ce/z/BeaNzE

This patch removes many unnecessary masking operations in Rust programs
with the `ptr_offset_from_unsigned` intrinsic :
https://github.com/dtcxzyw/llvm-opt-benchmark/pull/2538/files



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