[all-commits] [llvm/llvm-project] c4b155: [DAG] Fold (setcc ((x | x >> c0 | ...) & mask)) se...

Pierre van Houtryve via All-commits all-commits at lists.llvm.org
Wed Jul 30 01:27:40 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c4b155709714fb3381049b6d523c1f518dc363f5
      https://github.com/llvm/llvm-project/commit/c4b155709714fb3381049b6d523c1f518dc363f5
  Author: Pierre van Houtryve <pierre.vanhoutryve at amd.com>
  Date:   2025-07-30 (Wed, 30 Jul 2025)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    A llvm/test/CodeGen/AMDGPU/merged-bfx-opt.ll
    M llvm/test/CodeGen/AMDGPU/workitem-intrinsic-opts.ll

  Log Message:
  -----------
  [DAG] Fold (setcc ((x | x >> c0 | ...) & mask)) sequences (#146054)

Fold sequences where we extract a bunch of contiguous bits from a value,
merge them into the low bit and then check if the low bits are zero or
not.

Usually the and would be on the outside (the leaves) of the expression,
but the DAG canonicalizes it to a single `and` at the root of the
expression.

The reason I put this in DAGCombiner instead of the target combiner is
because this is a generic, valid transform that's also fairly niche, so
there isn't much risk of a combine loop I think.

See #136727



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