[all-commits] [llvm/llvm-project] 477bb2: [GlobalISel] Add G_SADDSAT/G_UADDSAT/G_SSUBSAT/G_U...

Joel Walker via All-commits all-commits at lists.llvm.org
Mon Jul 13 05:30:29 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 477bb26c7c0c5eee0491ce058968ce3c4b89623b
      https://github.com/llvm/llvm-project/commit/477bb26c7c0c5eee0491ce058968ce3c4b89623b
  Author: Joel Walker <theagingboy05 at gmail.com>
  Date:   2026-07-13 (Mon, 13 Jul 2026)

  Changed paths:
    M llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
    A llvm/test/CodeGen/AArch64/GlobalISel/knownbits-sat.mir

  Log Message:
  -----------
  [GlobalISel] Add G_SADDSAT/G_UADDSAT/G_SSUBSAT/G_USUBSAT to computeKnownBits (#209075)

Add known-bits handling for the saturating arithmetic opcodes G_SADDSAT,
G_UADDSAT, G_SSUBSAT and G_USUBSAT in GISelValueTracking, using the
existing
`KnownBits::{sadd,uadd,ssub,usub}_sat` helpers - the same ones
ValueTracking
uses for the corresponding IR intrinsics. (On the SelectionDAG side only
`ISD::USUBSAT` is currently handled.)

The new test covers exact constant folding, all four saturation clamps
(255, 127, 0, -128), partially known operands, a vector case, and fully
unknown operands. Without the change, all of these results are unknown.

Part of #150515.

---
Assisted by Claude (Anthropic).



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