[all-commits] [llvm/llvm-project] 9fb174: [AMDGPU] Fix umin(sffbh(x), bitwidth) fold when x ...

Arseniy Obolenskiy via All-commits all-commits at lists.llvm.org
Fri Jun 5 07:49:57 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9fb174c2955ae7e0d3e1b73e2fc9d4b39105f1e8
      https://github.com/llvm/llvm-project/commit/9fb174c2955ae7e0d3e1b73e2fc9d4b39105f1e8
  Author: Arseniy Obolenskiy <arseniy.obolenskiy at amd.com>
  Date:   2026-06-05 (Fri, 05 Jun 2026)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIISelLowering.cpp
    M llvm/test/CodeGen/AMDGPU/ctls.ll

  Log Message:
  -----------
  [AMDGPU] Fix umin(sffbh(x), bitwidth) fold when x may be all-ones (#201795)

We can drop the umin clamp only if x is neither 0 nor -1. There is a
problem with -1 check:
- old: The old guard `!isAllOnes()` is too weak because if the bit is
not definitely unknown (could be either 0 or 1) this check will not work
properly
- new: `Known.Zero.getBoolValue()` guarantees that there is at least one
`0` bit which means that the value is definitely not -1 which is needed
for this specific case



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